<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>File Source for geshi.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
						<h1>Source for file geshi.php</h1>
<p>Documentation is available at <a href="../core/_geshi_php.html">geshi.php</a></p>
<div class="src-code">
<pre><a name="a1"></a><br />1     <span class="src-php">&lt;?php</span><a name="a2"></a><br />2     <span class="src-doc">/**</span><a name="a3"></a><br />3     <span class="src-doc"> * GeSHi - Generic Syntax Highlighter</span><a name="a4"></a><br />4     <span class="src-doc"> * </span><a name="a5"></a><br />5     <span class="src-doc"> * The GeSHi class for Generic Syntax Highlighting. Please refer to the documentation</span><a name="a6"></a><br />6     <span class="src-doc"> * at http://qbnz.com/highlighter/documentation.php for more information about how to</span><a name="a7"></a><br />7     <span class="src-doc"> * use this class.</span><a name="a8"></a><br />8     <span class="src-doc"> *</span><a name="a9"></a><br />9     <span class="src-doc"> * For changes, release notes, TODOs etc, see the relevant files in the docs/ directory</span><a name="a10"></a><br />10    <span class="src-doc"> *</span><a name="a11"></a><br />11    <span class="src-doc"> *   This file is part of GeSHi.</span><a name="a12"></a><br />12    <span class="src-doc"> *</span><a name="a13"></a><br />13    <span class="src-doc"> *  GeSHi is free software; you can redistribute it and/or modify</span><a name="a14"></a><br />14    <span class="src-doc"> *  it under the terms of the GNU General Public License as published by</span><a name="a15"></a><br />15    <span class="src-doc"> *  the Free Software Foundation; either version 2 of the License, or</span><a name="a16"></a><br />16    <span class="src-doc"> *  (at your option) any later version.</span><a name="a17"></a><br />17    <span class="src-doc"> *</span><a name="a18"></a><br />18    <span class="src-doc"> *  GeSHi is distributed in the hope that it will be useful,</span><a name="a19"></a><br />19    <span class="src-doc"> *  but WITHOUT ANY WARRANTY; without even the implied warranty of</span><a name="a20"></a><br />20    <span class="src-doc"> *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><a name="a21"></a><br />21    <span class="src-doc"> *  GNU General Public License for more details.</span><a name="a22"></a><br />22    <span class="src-doc"> *</span><a name="a23"></a><br />23    <span class="src-doc"> *  You should have received a copy of the GNU General Public License</span><a name="a24"></a><br />24    <span class="src-doc"> *  along with GeSHi; if not, write to the Free Software</span><a name="a25"></a><br />25    <span class="src-doc"> *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span><a name="a26"></a><br />26    <span class="src-doc"> * </span><a name="a27"></a><br />27    <span class="src-doc"> *</span><span class="src-doc"> </span><span class="src-doc-coretag">@package</span><span class="src-doc">   core</span><a name="a28"></a><br />28    <span class="src-doc"> *</span><span class="src-doc"> </span><span class="src-doc-coretag">@author</span><span class="src-doc">    Nigel McNie &lt;nigel@geshi.org&gt;</span><a name="a29"></a><br />29    <span class="src-doc"> *</span><span class="src-doc"> </span><span class="src-doc-coretag">@copyright</span><span class="src-doc"> Copyright &amp;copy; 2004, 2005, Nigel McNie</span><a name="a30"></a><br />30    <span class="src-doc"> *</span><span class="src-doc"> </span><span class="src-doc-coretag">@license</span><span class="src-doc">   http://gnu.org/copyleft/gpl.html GNU GPL</span><a name="a31"></a><br />31    <span class="src-doc"> *</span><span class="src-doc"> </span><span class="src-doc-coretag">@version</span><span class="src-doc">   $Id: geshi.php,v 1.15 2005/09/22 01:41:46 oracleshinoda Exp $</span><a name="a32"></a><br />32    <span class="src-doc"> *</span><a name="a33"></a><br />33    <span class="src-doc"> */</span><a name="a34"></a><br />34    <a name="a35"></a><br />35    <span class="src-comm">//</span><a name="a36"></a><br />36    <span class="src-comm">// GeSHi Constants</span><a name="a37"></a><br />37    <span class="src-comm">// You should use these constant names in your programs instead of</span><a name="a38"></a><br />38    <span class="src-comm">// their values - you never know when a value may change in a future</span><a name="a39"></a><br />39    <span class="src-comm">// version</span><a name="a40"></a><br />40    <span class="src-comm">//</span><a name="a41"></a><br />41    <a name="a42"></a><br />42    <span class="src-doc">/** The version of this GeSHi file */</span><a name="a42"></a><br />42    <a name="a43"></a><br />43    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_VERSION'</span><span class="src-sym">,</span> <span class="src-str">'1.0.7.3'</span><span class="src-sym">)</span>;<a name="a44"></a><br />44    <a name="a45"></a><br />45    <span class="src-doc">/** For the future (though this may never be realised) */</span><a name="a45"></a><br />45    <a name="a46"></a><br />46    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_OUTPUT_HTML'</span><span class="src-sym">,</span> <span class="src-num">0</span><span class="src-sym">)</span>;<a name="a47"></a><br />47    <a name="a48"></a><br />48    <span class="src-doc">/** Set the correct directory separator */</span><a name="a48"></a><br />48    <a name="a49"></a><br />49    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_DIR_SEPARATOR'</span><span class="src-sym">,</span> <span class="src-sym">(</span><span class="src-str">'WIN'</span> != <span class="src-id">substr</span><span class="src-sym">(</span><span class="src-id">PHP_OS</span><span class="src-sym">,</span> <span class="src-num">0</span><span class="src-sym">,</span> <span class="src-num">3</span><span class="src-sym">)</span><span class="src-sym">)</span> ? <span class="src-str">'/'</span> : <span class="src-str">'\\'</span><span class="src-sym">)</span>;<a name="a50"></a><br />50    <a name="a51"></a><br />51    <span class="src-comm">// Define the root directory for the GeSHi code tree</span><a name="a52"></a><br />52    <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/defined">defined</a><span class="src-sym">(</span><span class="src-str">'GESHI_ROOT'</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a53"></a><br />53        <span class="src-doc">/** The root directory for GeSHi */</span><a name="a53"></a><br />53    <a name="a54"></a><br />54        <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_ROOT'</span><span class="src-sym">,</span> <span class="src-id">dirname</span><span class="src-sym">(</span>__FILE__<span class="src-sym">)</span> . <span class="src-id">GESHI_DIR_SEPARATOR</span><span class="src-sym">)</span>;<a name="a55"></a><br />55    <span class="src-sym">}</span><a name="a56"></a><br />56    <span class="src-doc">/** The language file directory for GeSHi</span><a name="a57"></a><br />57    <span class="src-doc">    @access private */</span><a name="a58"></a><br />58    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_LANG_ROOT'</span><span class="src-sym">,</span> <span class="src-id">GESHI_ROOT</span> . <span class="src-str">'geshi'</span> . <span class="src-id">GESHI_DIR_SEPARATOR</span><span class="src-sym">)</span>;<a name="a59"></a><br />59    <a name="a60"></a><br />60    <a name="a61"></a><br />61    <span class="src-comm">// Line numbers - use with enable_line_numbers()</span><a name="a62"></a><br />62    <span class="src-doc">/** Use no line numbers when building the result */</span><a name="a62"></a><br />62    <a name="a63"></a><br />63    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NO_LINE_NUMBERS'</span><span class="src-sym">,</span> <span class="src-num">0</span><span class="src-sym">)</span>;<a name="a64"></a><br />64    <span class="src-doc">/** Use normal line numbers when building the result */</span><a name="a64"></a><br />64    <a name="a65"></a><br />65    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NORMAL_LINE_NUMBERS'</span><span class="src-sym">,</span> <span class="src-num">1</span><span class="src-sym">)</span>;<a name="a66"></a><br />66    <span class="src-doc">/** Use fancy line numbers when building the result */</span><a name="a66"></a><br />66    <a name="a67"></a><br />67    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_FANCY_LINE_NUMBERS'</span><span class="src-sym">,</span> <span class="src-num">2</span><span class="src-sym">)</span>;<a name="a68"></a><br />68    <a name="a69"></a><br />69    <span class="src-comm">// Container HTML type</span><a name="a70"></a><br />70    <span class="src-doc">/** Use nothing to surround the source */</span><a name="a70"></a><br />70    <a name="a71"></a><br />71    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_HEADER_NONE'</span><span class="src-sym">,</span> <span class="src-num">0</span><span class="src-sym">)</span>;<a name="a72"></a><br />72    <span class="src-doc">/** Use a &quot;div&quot; to surround the source */</span><a name="a72"></a><br />72    <a name="a73"></a><br />73    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_HEADER_DIV'</span><span class="src-sym">,</span> <span class="src-num">1</span><span class="src-sym">)</span>;<a name="a74"></a><br />74    <span class="src-doc">/** Use a &quot;pre&quot; to surround the source */</span><a name="a74"></a><br />74    <a name="a75"></a><br />75    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_HEADER_PRE'</span><span class="src-sym">,</span> <span class="src-num">2</span><span class="src-sym">)</span>;<a name="a76"></a><br />76    <a name="a77"></a><br />77    <span class="src-comm">// Capatalisation constants</span><a name="a78"></a><br />78    <span class="src-doc">/** Lowercase keywords found */</span><a name="a78"></a><br />78    <a name="a79"></a><br />79    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_CAPS_NO_CHANGE'</span><span class="src-sym">,</span> <span class="src-num">0</span><span class="src-sym">)</span>;<a name="a80"></a><br />80    <span class="src-doc">/** Uppercase keywords found */</span><a name="a80"></a><br />80    <a name="a81"></a><br />81    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_CAPS_UPPER'</span><span class="src-sym">,</span> <span class="src-num">1</span><span class="src-sym">)</span>;<a name="a82"></a><br />82    <span class="src-doc">/** Leave keywords found as the case that they are */</span><a name="a82"></a><br />82    <a name="a83"></a><br />83    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_CAPS_LOWER'</span><span class="src-sym">,</span> <span class="src-num">2</span><span class="src-sym">)</span>;<a name="a84"></a><br />84    <a name="a85"></a><br />85    <span class="src-comm">// Link style constants</span><a name="a86"></a><br />86    <span class="src-doc">/** Links in the source in the :link state */</span><a name="a86"></a><br />86    <a name="a87"></a><br />87    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_LINK'</span><span class="src-sym">,</span> <span class="src-num">0</span><span class="src-sym">)</span>;<a name="a88"></a><br />88    <span class="src-doc">/** Links in the source in the :hover state */</span><a name="a88"></a><br />88    <a name="a89"></a><br />89    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_HOVER'</span><span class="src-sym">,</span> <span class="src-num">1</span><span class="src-sym">)</span>;<a name="a90"></a><br />90    <span class="src-doc">/** Links in the source in the :active state */</span><a name="a90"></a><br />90    <a name="a91"></a><br />91    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_ACTIVE'</span><span class="src-sym">,</span> <span class="src-num">2</span><span class="src-sym">)</span>;<a name="a92"></a><br />92    <span class="src-doc">/** Links in the source in the :visited state */</span><a name="a92"></a><br />92    <a name="a93"></a><br />93    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_VISITED'</span><span class="src-sym">,</span> <span class="src-num">3</span><span class="src-sym">)</span>;<a name="a94"></a><br />94    <a name="a95"></a><br />95    <span class="src-comm">// Important string starter/finisher</span><a name="a96"></a><br />96    <span class="src-comm">// Note that if you change these, they should be as-is: i.e., don't</span><a name="a97"></a><br />97    <span class="src-comm">// write them as if they had been run through htmlentities()</span><a name="a98"></a><br />98    <span class="src-doc">/** The starter for important parts of the source */</span><a name="a98"></a><br />98    <a name="a99"></a><br />99    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_START_IMPORTANT'</span><span class="src-sym">,</span> <span class="src-str">'&lt;BEGIN GeSHi&gt;'</span><span class="src-sym">)</span>;<a name="a100"></a><br />100   <span class="src-doc">/** The ender for important parts of the source */</span><a name="a100"></a><br />100   <a name="a101"></a><br />101   <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_END_IMPORTANT'</span><span class="src-sym">,</span> <span class="src-str">'&lt;END GeSHi&gt;'</span><span class="src-sym">)</span>;<a name="a102"></a><br />102   <a name="a103"></a><br />103   <span class="src-doc-template">/**#@+</span><a name="a104"></a><br />104   <span class="src-doc-template"> *</span><span class="src-doc-template">  </span><span class="src-doc-coretag">@access</span><span class="src-doc-template"> private</span><a name="a105"></a><br />105   <span class="src-doc-template"> */</span><a name="a106"></a><br />106   <span class="src-comm">// When strict mode applies for a language</span><a name="a107"></a><br />107   <span class="src-doc">/** Strict mode never applies (this is the most common) */</span><a name="a107"></a><br />107   <a name="a108"></a><br />108   <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NEVER'</span><span class="src-sym">,</span> <span class="src-num">0</span><span class="src-sym">)</span>;<a name="a109"></a><br />109   <span class="src-doc">/** Strict mode *might* apply, and can be enabled or</span><a name="a110"></a><br />110   <span class="src-doc">    disabled by </span><span class="src-doc-inlinetag">{@link GeSHi::enable_strict_mode()}</span><span class="src-doc"> */</span><a name="a111"></a><br />111   <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_MAYBE'</span><span class="src-sym">,</span> <span class="src-num">1</span><span class="src-sym">)</span>;<a name="a112"></a><br />112   <span class="src-doc">/** Strict mode always applies */</span><a name="a112"></a><br />112   <a name="a113"></a><br />113   <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_ALWAYS'</span><span class="src-sym">,</span> <span class="src-num">2</span><span class="src-sym">)</span>;<a name="a114"></a><br />114   <a name="a115"></a><br />115   <span class="src-comm">// Advanced regexp handling constants, used in language files</span><a name="a116"></a><br />116   <span class="src-doc">/** The key of the regex array defining what to search for */</span><a name="a116"></a><br />116   <a name="a117"></a><br />117   <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_SEARCH'</span><span class="src-sym">,</span> <span class="src-num">0</span><span class="src-sym">)</span>;<a name="a118"></a><br />118   <span class="src-doc">/** The key of the regex array defining what bracket group in a</span><a name="a119"></a><br />119   <span class="src-doc">    matched search to use as a replacement */</span><a name="a120"></a><br />120   <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_REPLACE'</span><span class="src-sym">,</span> <span class="src-num">1</span><span class="src-sym">)</span>;<a name="a121"></a><br />121   <span class="src-doc">/** The key of the regex array defining any modifiers to the regular expression */</span><a name="a121"></a><br />121   <a name="a122"></a><br />122   <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_MODIFIERS'</span><span class="src-sym">,</span> <span class="src-num">2</span><span class="src-sym">)</span>;<a name="a123"></a><br />123   <span class="src-doc">/** The key of the regex array defining what bracket group in a</span><a name="a124"></a><br />124   <span class="src-doc">    matched search to put before the replacement */</span> <a name="a125"></a><br />125   <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_BEFORE'</span><span class="src-sym">,</span> <span class="src-num">3</span><span class="src-sym">)</span>;<a name="a126"></a><br />126   <span class="src-doc">/** The key of the regex array defining what bracket group in a</span><a name="a127"></a><br />127   <span class="src-doc">    matched search to put after the replacement */</span> <a name="a128"></a><br />128   <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_AFTER'</span><span class="src-sym">,</span> <span class="src-num">4</span><span class="src-sym">)</span>;<a name="a129"></a><br />129   <a name="a130"></a><br />130   <span class="src-doc">/** Used in language files to mark comments */</span><a name="a130"></a><br />130   <a name="a131"></a><br />131   <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_COMMENTS'</span><span class="src-sym">,</span> <span class="src-num">0</span><span class="src-sym">)</span>;<a name="a132"></a><br />132   <a name="a133"></a><br />133   <span class="src-comm">// Error detection - use these to analyse faults</span><a name="a134"></a><br />134   <span class="src-doc">/** No sourcecode to highlight was specified */</span><a name="a134"></a><br />134   <a name="a135"></a><br />135   <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_ERROR_NO_INPUT'</span><span class="src-sym">,</span> <span class="src-num">1</span><span class="src-sym">)</span>;<a name="a136"></a><br />136   <span class="src-doc">/** The language specified does not exist */</span><a name="a136"></a><br />136   <a name="a137"></a><br />137   <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_ERROR_NO_SUCH_LANG'</span><span class="src-sym">,</span> <span class="src-num">2</span><span class="src-sym">)</span>;<a name="a138"></a><br />138   <span class="src-doc">/** GeSHi could not open a file for reading (generally a language file) */</span><a name="a138"></a><br />138   <a name="a139"></a><br />139   <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_ERROR_FILE_NOT_READABLE'</span><span class="src-sym">,</span> <span class="src-num">3</span><span class="src-sym">)</span>;<a name="a140"></a><br />140   <span class="src-doc">/** The header type passed to </span><span class="src-doc-inlinetag">{@link GeSHi::set_header_type()}</span><span class="src-doc"> was invalid */</span><a name="a140"></a><br />140   <a name="a141"></a><br />141   <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_ERROR_INVALID_HEADER_TYPE'</span><span class="src-sym">,</span> <span class="src-num">4</span><span class="src-sym">)</span>;<a name="a142"></a><br />142   <span class="src-doc">/** The line number type passed to </span><span class="src-doc-inlinetag">{@link GeSHi::enable_line_numbers()}</span><span class="src-doc"> was invalid */</span><a name="a142"></a><br />142   <a name="a143"></a><br />143   <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_ERROR_INVALID_LINE_NUMBER_TYPE'</span><span class="src-sym">,</span> <span class="src-num">5</span><span class="src-sym">)</span>;<a name="a144"></a><br />144   <span class="src-doc-close-template">/**#@-*/</span><a name="a145"></a><br />145   <a name="a146"></a><br />146   <a name="a147"></a><br />147   <span class="src-doc">/**</span><a name="a148"></a><br />148   <span class="src-doc"> * The GeSHi Class.</span><a name="a149"></a><br />149   <span class="src-doc"> *</span><a name="a150"></a><br />150   <span class="src-doc"> * Please refer to the documentation for GeSHi 1.0.X that is available</span><a name="a151"></a><br />151   <span class="src-doc"> * at http://qbnz.com/highlighter/documentation.php for more information</span><a name="a152"></a><br />152   <span class="src-doc"> * about how to use this class.</span><a name="a153"></a><br />153   <span class="src-doc"> * </span><a name="a154"></a><br />154   <span class="src-doc"> *</span><span class="src-doc"> </span><span class="src-doc-coretag">@package</span><span class="src-doc">   core</span><a name="a155"></a><br />155   <span class="src-doc"> *</span><span class="src-doc"> </span><span class="src-doc-coretag">@author</span><span class="src-doc">    Nigel McNie &lt;nigel@geshi.org&gt;</span><a name="a156"></a><br />156   <span class="src-doc"> *</span><span class="src-doc"> </span><span class="src-doc-coretag">@copyright</span><span class="src-doc"> Copyright &amp;copy; 2004, 2005 Nigel McNie</span><a name="a157"></a><br />157   <span class="src-doc"> */</span><a name="a158"></a><br />158   <span class="src-key">class</span> <a href="../core/GeSHi.html">GeSHi</a><a name="a159"></a><br />159   <span class="src-sym">{</span><a name="a160"></a><br />160       <span class="src-doc-template">/**#@+</span><a name="a161"></a><br />161   <span class="src-doc-template">     *</span><span class="src-doc-template"> </span><span class="src-doc-coretag">@access</span><span class="src-doc-template"> private</span><a name="a162"></a><br />162   <span class="src-doc-template">     */</span><a name="a163"></a><br />163       <span class="src-doc">/**</span><a name="a164"></a><br />164   <span class="src-doc">     * The source code to highlight</span><a name="a165"></a><br />165   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><a name="a166"></a><br />166   <span class="src-doc">     */</span><a name="a167"></a><br />167       <span class="src-key">var</span> <span class="src-var">$source</span> = <span class="src-str">''</span>;<a name="a168"></a><br />168       <a name="a169"></a><br />169       <span class="src-doc">/**</span><a name="a170"></a><br />170   <span class="src-doc">     * The language to use when highlighting</span><a name="a171"></a><br />171   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><a name="a172"></a><br />172   <span class="src-doc">     */</span><a name="a173"></a><br />173       <span class="src-key">var</span> <span class="src-var">$language</span> = <span class="src-str">''</span>;<a name="a174"></a><br />174       <a name="a175"></a><br />175       <span class="src-doc">/**</span><a name="a176"></a><br />176   <span class="src-doc">     * The data for the language used</span><a name="a177"></a><br />177   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">array </span><a name="a178"></a><br />178   <span class="src-doc">     */</span><a name="a179"></a><br />179       <span class="src-key">var</span> <span class="src-var">$language_data</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a180"></a><br />180       <a name="a181"></a><br />181       <span class="src-doc">/**</span><a name="a182"></a><br />182   <span class="src-doc">     * The path to the language files</span><a name="a183"></a><br />183   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><a name="a184"></a><br />184   <span class="src-doc">     */</span><a name="a185"></a><br />185       <span class="src-key">var</span> <span class="src-var">$language_path</span> = <span class="src-id">GESHI_LANG_ROOT</span>;<a name="a186"></a><br />186       <a name="a187"></a><br />187       <span class="src-doc">/**</span><a name="a188"></a><br />188   <span class="src-doc">     * The error message associated with an error</span><a name="a189"></a><br />189   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><a name="a190"></a><br />190   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@todo</span><span class="src-doc"> check err reporting works</span><a name="a191"></a><br />191   <span class="src-doc">     */</span><a name="a192"></a><br />192       <span class="src-key">var</span> <span class="src-var">$error</span> = <span class="src-id">false</span>;<a name="a193"></a><br />193       <a name="a194"></a><br />194       <span class="src-doc">/**</span><a name="a195"></a><br />195   <span class="src-doc">     * Possible error messages</span><a name="a196"></a><br />196   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">array </span><a name="a197"></a><br />197   <span class="src-doc">     */</span><a name="a198"></a><br />198       <span class="src-key">var</span> <span class="src-var">$error_messages</span> = <span class="src-key">array</span><span class="src-sym">(</span><a name="a199"></a><br />199           <span class="src-id">GESHI_ERROR_NO_INPUT</span> =&gt; <span class="src-str">'No source code inputted'</span><span class="src-sym">,</span><a name="a200"></a><br />200           <span class="src-id">GESHI_ERROR_NO_SUCH_LANG</span> =&gt; <span class="src-str">'GeSHi could not find the language {LANGUAGE} (using path {PATH})'</span><span class="src-sym">,</span><a name="a201"></a><br />201           <span class="src-id">GESHI_ERROR_FILE_NOT_READABLE</span> =&gt; <span class="src-str">'The file specified for load_from_file was not readable'</span><span class="src-sym">,</span><a name="a202"></a><br />202           <span class="src-id">GESHI_ERROR_INVALID_HEADER_TYPE</span> =&gt; <span class="src-str">'The header type specified is invalid'</span><span class="src-sym">,</span><a name="a203"></a><br />203           <span class="src-id">GESHI_ERROR_INVALID_LINE_NUMBER_TYPE</span> =&gt; <span class="src-str">'The line number type specified is invalid'</span><a name="a204"></a><br />204       <span class="src-sym">)</span>;<a name="a205"></a><br />205       <a name="a206"></a><br />206       <span class="src-doc">/**</span><a name="a207"></a><br />207   <span class="src-doc">     * Whether highlighting is strict or not</span><a name="a208"></a><br />208   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><a name="a209"></a><br />209   <span class="src-doc">     */</span><a name="a210"></a><br />210       <span class="src-key">var</span> <span class="src-var">$strict_mode</span> = <span class="src-id">false</span>;<a name="a211"></a><br />211       <a name="a212"></a><br />212       <span class="src-doc">/**</span><a name="a213"></a><br />213   <span class="src-doc">     * Whether to use CSS classes in output</span><a name="a214"></a><br />214   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><a name="a215"></a><br />215   <span class="src-doc">     */</span><a name="a216"></a><br />216       <span class="src-key">var</span> <span class="src-var">$use_classes</span> = <span class="src-id">false</span>;<a name="a217"></a><br />217       <a name="a218"></a><br />218       <span class="src-doc">/**</span><a name="a219"></a><br />219   <span class="src-doc">     * The type of header to use. Can be one of the following</span><a name="a220"></a><br />220   <span class="src-doc">     * values:</span><a name="a221"></a><br />221   <span class="src-doc">     * </span><a name="a222"></a><br />222   <span class="src-doc">     * &lt;ul&gt;</span><a name="a223"></a><br />223   <span class="src-doc">     *   &lt;li&gt;&lt;b&gt;GESHI_HEADER_PRE&lt;/b&gt;: Source is outputted in</span><a name="a224"></a><br />224   <span class="src-doc">     *   a &amp;lt;pre&amp;gt; HTML element.&lt;/li&gt;</span><a name="a225"></a><br />225   <span class="src-doc">     *   &lt;li&gt;&lt;b&gt;GESHI_HEADER_DIV&lt;/b&gt;: Source is outputted in</span><a name="a226"></a><br />226   <span class="src-doc">     *   a &amp;lt;div&amp;gt; HTML element.&lt;/li&gt;</span><a name="a227"></a><br />227   <span class="src-doc">     * &lt;/ul&gt;</span><a name="a228"></a><br />228   <span class="src-doc">     * </span><a name="a229"></a><br />229   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">int </span><a name="a230"></a><br />230   <span class="src-doc">     */</span><a name="a231"></a><br />231       <span class="src-key">var</span> <span class="src-var">$header_type</span> = <span class="src-id">GESHI_HEADER_PRE</span>;<a name="a232"></a><br />232       <a name="a233"></a><br />233       <span class="src-doc">/**</span><a name="a234"></a><br />234   <span class="src-doc">     * Array of permissions for which lexics should be highlighted</span><a name="a235"></a><br />235   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">array </span><a name="a236"></a><br />236   <span class="src-doc">     */</span><a name="a237"></a><br />237       <span class="src-key">var</span> <span class="src-var">$lexic_permissions</span> = <span class="src-key">array</span><span class="src-sym">(</span><a name="a238"></a><br />238           <span class="src-str">'KEYWORDS'</span> =&gt;    <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a239"></a><br />239           <span class="src-str">'COMMENTS'</span> =&gt;    <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'MULTI'</span> =&gt; <span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a240"></a><br />240           <span class="src-str">'REGEXPS'</span> =&gt;     <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a241"></a><br />241           <span class="src-str">'ESCAPE_CHAR'</span> =&gt; <span class="src-id">true</span><span class="src-sym">,</span><a name="a242"></a><br />242           <span class="src-str">'BRACKETS'</span> =&gt;    <span class="src-id">true</span><span class="src-sym">,</span><a name="a243"></a><br />243           <span class="src-str">'SYMBOLS'</span> =&gt;     <span class="src-id">true</span><span class="src-sym">,</span><a name="a244"></a><br />244           <span class="src-str">'STRINGS'</span> =&gt;     <span class="src-id">true</span><span class="src-sym">,</span><a name="a245"></a><br />245           <span class="src-str">'NUMBERS'</span> =&gt;     <span class="src-id">true</span><span class="src-sym">,</span><a name="a246"></a><br />246           <span class="src-str">'METHODS'</span> =&gt;     <span class="src-id">true</span><span class="src-sym">,</span><a name="a247"></a><br />247           <span class="src-str">'SCRIPT'</span> =&gt;      <span class="src-id">true</span><a name="a248"></a><br />248       <span class="src-sym">)</span>;<a name="a249"></a><br />249   <a name="a250"></a><br />250       <span class="src-doc">/**</span><a name="a251"></a><br />251   <span class="src-doc">     * The time it took to parse the code</span><a name="a252"></a><br />252   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">double </span><a name="a253"></a><br />253   <span class="src-doc">     */</span><a name="a254"></a><br />254       <span class="src-key">var</span> <span class="src-var">$time</span> = <span class="src-num">0</span>;<a name="a255"></a><br />255       <a name="a256"></a><br />256       <span class="src-doc">/**</span><a name="a257"></a><br />257   <span class="src-doc">     * The content of the header block</span><a name="a258"></a><br />258   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><a name="a259"></a><br />259   <span class="src-doc">     */</span><a name="a260"></a><br />260       <span class="src-key">var</span> <span class="src-var">$header_content</span> = <span class="src-str">''</span>;<a name="a261"></a><br />261       <a name="a262"></a><br />262       <span class="src-doc">/**</span><a name="a263"></a><br />263   <span class="src-doc">     * The content of the footer block</span><a name="a264"></a><br />264   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><a name="a265"></a><br />265   <span class="src-doc">     */</span><a name="a266"></a><br />266       <span class="src-key">var</span> <span class="src-var">$footer_content</span> = <span class="src-str">''</span>;<a name="a267"></a><br />267       <a name="a268"></a><br />268       <span class="src-doc">/**</span><a name="a269"></a><br />269   <span class="src-doc">     * The style of the header block</span><a name="a270"></a><br />270   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><a name="a271"></a><br />271   <span class="src-doc">     */</span><a name="a272"></a><br />272       <span class="src-key">var</span> <span class="src-var">$header_content_style</span> = <span class="src-str">''</span>;<a name="a273"></a><br />273       <a name="a274"></a><br />274       <span class="src-doc">/**</span><a name="a275"></a><br />275   <span class="src-doc">     * The style of the footer block</span><a name="a276"></a><br />276   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><a name="a277"></a><br />277   <span class="src-doc">     */</span><a name="a278"></a><br />278       <span class="src-key">var</span> <span class="src-var">$footer_content_style</span> = <span class="src-str">''</span>;<a name="a279"></a><br />279       <a name="a280"></a><br />280       <span class="src-doc">/**</span><a name="a281"></a><br />281   <span class="src-doc">     * The styles for hyperlinks in the code</span><a name="a282"></a><br />282   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">array </span><a name="a283"></a><br />283   <span class="src-doc">     */</span><a name="a284"></a><br />284       <span class="src-key">var</span> <span class="src-var">$link_styles</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a285"></a><br />285       <a name="a286"></a><br />286       <span class="src-doc">/**</span><a name="a287"></a><br />287   <span class="src-doc">     * Whether important blocks should be recognised or not</span><a name="a288"></a><br />288   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><a name="a289"></a><br />289   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@todo</span><span class="src-doc"> REMOVE THIS FUNCTIONALITY!</span><a name="a290"></a><br />290   <span class="src-doc">     */</span><a name="a291"></a><br />291       <span class="src-key">var</span> <span class="src-var">$enable_important_blocks</span> = <span class="src-id">false</span>;<a name="a292"></a><br />292       <a name="a293"></a><br />293       <span class="src-doc">/**</span><a name="a294"></a><br />294   <span class="src-doc">     * Styles for important parts of the code</span><a name="a295"></a><br />295   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><a name="a296"></a><br />296   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@todo</span><span class="src-doc"> As above - rethink the whole idea of important blocks as it is buggy and</span><a name="a297"></a><br />297   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc"> will be hard to implement in 1.2</span><a name="a298"></a><br />298   <span class="src-doc">     */</span><a name="a299"></a><br />299       <span class="src-key">var</span> <span class="src-var">$important_styles</span> = <span class="src-str">'font-weight: bold; color: red;'</span>; <span class="src-comm">// Styles for important parts of the code</span><a name="a300"></a><br />300       <a name="a301"></a><br />301       <span class="src-doc">/**</span><a name="a302"></a><br />302   <span class="src-doc">     * Whether CSS IDs should be added to the code</span><a name="a303"></a><br />303   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><a name="a304"></a><br />304   <span class="src-doc">     */</span><a name="a305"></a><br />305       <span class="src-key">var</span> <span class="src-var">$add_ids</span> = <span class="src-id">false</span>;<a name="a306"></a><br />306       <a name="a307"></a><br />307       <span class="src-doc">/**</span><a name="a308"></a><br />308   <span class="src-doc">     * Lines that should be highlighted extra</span><a name="a309"></a><br />309   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">array </span><a name="a310"></a><br />310   <span class="src-doc">     */</span><a name="a311"></a><br />311       <span class="src-key">var</span> <span class="src-var">$highlight_extra_lines</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a312"></a><br />312       <a name="a313"></a><br />313       <span class="src-doc">/**</span><a name="a314"></a><br />314   <span class="src-doc">     * Styles of extra-highlighted lines</span><a name="a315"></a><br />315   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><a name="a316"></a><br />316   <span class="src-doc">     */</span><a name="a317"></a><br />317       <span class="src-key">var</span> <span class="src-var">$highlight_extra_lines_style</span> = <span class="src-str">'color: #cc0; background-color: #ffc;'</span>;<a name="a318"></a><br />318       <a name="a319"></a><br />319       <span class="src-doc">/**</span><a name="a320"></a><br />320   <span class="src-doc">     * Number at which line numbers should start at</span><a name="a321"></a><br />321   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">int </span><a name="a322"></a><br />322   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@todo</span><span class="src-doc"> Warning documentation about XHTML compliance</span><a name="a323"></a><br />323   <span class="src-doc">     */</span><a name="a324"></a><br />324       <span class="src-key">var</span> <span class="src-var">$line_numbers_start</span> = <span class="src-num">1</span>;<a name="a325"></a><br />325   <a name="a326"></a><br />326       <span class="src-doc">/**</span><a name="a327"></a><br />327   <span class="src-doc">     * The overall style for this code block</span><a name="a328"></a><br />328   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><a name="a329"></a><br />329   <span class="src-doc">	 */</span><a name="a330"></a><br />330       <span class="src-key">var</span> <span class="src-var">$overall_style</span> = <span class="src-str">''</span>;<a name="a331"></a><br />331       <a name="a332"></a><br />332       <span class="src-doc">/**</span><a name="a333"></a><br />333   <span class="src-doc">     *  The style for the actual code</span><a name="a334"></a><br />334   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><a name="a335"></a><br />335   <span class="src-doc">     */</span><a name="a336"></a><br />336       <span class="src-key">var</span> <span class="src-var">$code_style</span> = <span class="src-str">'font-family: \'Courier New\', Courier, monospace; font-weight: normal;'</span>;<a name="a337"></a><br />337       <a name="a338"></a><br />338       <span class="src-doc">/**</span><a name="a339"></a><br />339   <span class="src-doc">     * The overall class for this code block</span><a name="a340"></a><br />340   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><a name="a341"></a><br />341   <span class="src-doc">     */</span><a name="a342"></a><br />342       <span class="src-key">var</span> <span class="src-var">$overall_class</span> = <span class="src-str">''</span>;<a name="a343"></a><br />343       <a name="a344"></a><br />344       <span class="src-doc">/**</span><a name="a345"></a><br />345   <span class="src-doc">     * The overall ID for this code block</span><a name="a346"></a><br />346   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><a name="a347"></a><br />347   <span class="src-doc">     */</span><a name="a348"></a><br />348       <span class="src-key">var</span> <span class="src-var">$overall_id</span> = <span class="src-str">''</span>;<a name="a349"></a><br />349       <a name="a350"></a><br />350       <span class="src-doc">/**</span><a name="a351"></a><br />351   <span class="src-doc">     * Line number styles</span><a name="a352"></a><br />352   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><a name="a353"></a><br />353   <span class="src-doc">     */</span><a name="a354"></a><br />354       <span class="src-key">var</span> <span class="src-var">$line_style1</span> = <span class="src-str">'font-family: \'Courier New\', Courier, monospace; color: black; font-weight: normal; font-style: normal;'</span>;<a name="a355"></a><br />355       <a name="a356"></a><br />356       <span class="src-doc">/**</span><a name="a357"></a><br />357   <span class="src-doc">     * Line number styles for fancy lines</span><a name="a358"></a><br />358   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><a name="a359"></a><br />359   <span class="src-doc">     */</span><a name="a360"></a><br />360       <span class="src-key">var</span> <span class="src-var">$line_style2</span> = <span class="src-str">'font-weight: bold;'</span>;<a name="a361"></a><br />361       <a name="a362"></a><br />362       <span class="src-doc">/**</span><a name="a363"></a><br />363   <span class="src-doc">     * Flag for how line nubmers are displayed</span><a name="a364"></a><br />364   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><a name="a365"></a><br />365   <span class="src-doc">     */</span><a name="a366"></a><br />366       <span class="src-key">var</span> <span class="src-var">$line_numbers</span> = <span class="src-id">GESHI_NO_LINE_NUMBERS</span>;<a name="a367"></a><br />367       <a name="a368"></a><br />368       <span class="src-doc">/**</span><a name="a369"></a><br />369   <span class="src-doc">     * The &quot;nth&quot; value for fancy line highlighting</span><a name="a370"></a><br />370   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">int </span><a name="a371"></a><br />371   <span class="src-doc">     */</span><a name="a372"></a><br />372       <span class="src-key">var</span> <span class="src-var">$line_nth_row</span> = <span class="src-num">0</span>;<a name="a373"></a><br />373   <a name="a374"></a><br />374       <span class="src-doc">/**</span><a name="a375"></a><br />375   <span class="src-doc">     * The size of tab stops</span><a name="a376"></a><br />376   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">int </span><a name="a377"></a><br />377   <span class="src-doc">	 */</span><a name="a378"></a><br />378       <span class="src-key">var</span> <span class="src-var">$tab_width</span> = <span class="src-num">8</span>;<a name="a379"></a><br />379           <a name="a380"></a><br />380       <span class="src-doc">/**</span><a name="a381"></a><br />381   <span class="src-doc">     * Default target for keyword links</span><a name="a382"></a><br />382   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><a name="a383"></a><br />383   <span class="src-doc">     */</span><a name="a384"></a><br />384       <span class="src-key">var</span> <span class="src-var">$link_target</span> = <span class="src-str">''</span>;<a name="a385"></a><br />385       <a name="a386"></a><br />386       <span class="src-doc">/**</span><a name="a387"></a><br />387   <span class="src-doc">     * The encoding to use for entity encoding</span><a name="a388"></a><br />388   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><a name="a389"></a><br />389   <span class="src-doc">     */</span><a name="a390"></a><br />390       <span class="src-key">var</span> <span class="src-var">$encoding</span> = <span class="src-str">'ISO-8859-1'</span>;<a name="a391"></a><br />391   <a name="a392"></a><br />392       <span class="src-doc">/**</span><a name="a393"></a><br />393   <span class="src-doc">     * Unused (planned for future)</span><a name="a394"></a><br />394   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">int </span><a name="a395"></a><br />395   <span class="src-doc">	 */</span><a name="a396"></a><br />396       <span class="src-key">var</span> <span class="src-var">$output_format</span> = <span class="src-id">GESHI_OUTPUT_HTML</span>;<a name="a397"></a><br />397   <a name="a398"></a><br />398       <span class="src-doc-close-template">/**#@-*/</span><a name="a399"></a><br />399   <a name="a400"></a><br />400       <span class="src-doc">/**</span><a name="a401"></a><br />401   <span class="src-doc">	 * Creates a new GeSHi object, with source and language</span><a name="a402"></a><br />402   <span class="src-doc">     * </span><a name="a403"></a><br />403   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The source code to highlight</span><a name="a404"></a><br />404   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The language to highlight the source with</span><a name="a405"></a><br />405   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The path to the language file directory. &lt;b&gt;This</span><a name="a406"></a><br />406   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">               is deprecated!&lt;/b&gt; I've backported the auto path</span><a name="a407"></a><br />407   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">               detection from the 1.1.X dev branch, so now it</span><a name="a408"></a><br />408   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">               should be automatically set correctly. If you have</span><a name="a409"></a><br />409   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">               renamed the language directory however, you will</span><a name="a410"></a><br />410   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">               still need to set the path using this parameter or</span><a name="a411"></a><br />411   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">               </span><span class="src-doc-inlinetag">{@link GeSHi::set_language_path()}</span><span class="src-doc"></span><a name="a412"></a><br />412   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a413"></a><br />413   <span class="src-doc">	 */</span><a name="a414"></a><br />414       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodGeSHi">GeSHi</a> <span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">,</span> <span class="src-var">$language</span><span class="src-sym">,</span> <span class="src-var">$path</span> = <span class="src-str">''</span><span class="src-sym">)</span><a name="a415"></a><br />415       <span class="src-sym">{</span><a name="a416"></a><br />416           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../core/GeSHi.html#methodset_source">set_source</a><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">)</span>;<a name="a417"></a><br />417           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../core/GeSHi.html#methodset_language_path">set_language_path</a><span class="src-sym">(</span><span class="src-var">$path</span><span class="src-sym">)</span>;<a name="a418"></a><br />418           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../core/GeSHi.html#methodset_language">set_language</a><span class="src-sym">(</span><span class="src-var">$language</span><span class="src-sym">)</span>;<a name="a419"></a><br />419       <span class="src-sym">}</span><a name="a420"></a><br />420   <a name="a421"></a><br />421       <span class="src-doc">/**</span><a name="a422"></a><br />422   <span class="src-doc">	 * Returns an error message associated with the last GeSHi operation,</span><a name="a423"></a><br />423   <span class="src-doc">	 * or false if no error has occured</span><a name="a424"></a><br />424   <span class="src-doc">     * </span><a name="a425"></a><br />425   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@return </span><span class="src-doc"></span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">false</span><span class="src-doc"></span><span class="src-doc">An error message if there has been an error, else false</span><a name="a426"></a><br />426   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc">  1.0.0</span><a name="a427"></a><br />427   <span class="src-doc">	 */</span><a name="a428"></a><br />428       <span class="src-key">function</span> <a href="../core/GeSHi.html#methoderror">error</a> <span class="src-sym">(</span><span class="src-sym">)</span><a name="a429"></a><br />429       <span class="src-sym">{</span><a name="a430"></a><br />430           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a431"></a><br />431               <span class="src-var">$msg</span> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error_messages</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span><span class="src-sym">]</span>;<a name="a432"></a><br />432               <span class="src-var">$debug_tpl_vars</span> = <span class="src-key">array</span><span class="src-sym">(</span><a name="a433"></a><br />433                   <span class="src-str">'{LANGUAGE}'</span> =&gt; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language</span><span class="src-sym">,</span><a name="a434"></a><br />434                   <span class="src-str">'{PATH}'</span> =&gt; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a name="a435"></a><br />435   <span class="src-var">language_path</span>            <span class="src-sym">)</span>;<a name="a436"></a><br />436               <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$debug_tpl_vars</span> <span class="src-key">as</span> <span class="src-var">$tpl</span> =&gt; <span class="src-var">$var</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a437"></a><br />437                   <span class="src-var">$msg</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-var">$tpl</span><span class="src-sym">,</span> <span class="src-var">$var</span><span class="src-sym">,</span> <span class="src-var">$msg</span><span class="src-sym">)</span>;<a name="a438"></a><br />438               <span class="src-sym">}</span><a name="a439"></a><br />439               <span class="src-key">return</span> &quot;<span class="src-str">&lt;<span class="src-id">br</span> /&gt;&lt;<span class="src-id">strong</span>&gt;<span class="src-id">GeSHi</span> <span class="src-id">Error</span>:&lt;/<span class="src-id">strong</span>&gt; <span class="src-var">$msg</span> (<span class="src-id">code</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span>)&lt;<span class="src-id">br</span> /&gt;</span>&quot;;<a name="a440"></a><br />440           <span class="src-sym">}</span><a name="a441"></a><br />441           <span class="src-key">return</span> <span class="src-id">false</span>;<a name="a442"></a><br />442       <span class="src-sym">}</span><a name="a443"></a><br />443   <a name="a444"></a><br />444       <span class="src-doc">/**</span><a name="a445"></a><br />445   <span class="src-doc">	 * Gets a human-readable language name (thanks to Simon Patterson</span><a name="a446"></a><br />446   <span class="src-doc">	 * for the idea :))</span><a name="a447"></a><br />447   <span class="src-doc">     * </span><a name="a448"></a><br />448   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@return </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The name for the current language</span><a name="a449"></a><br />449   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc">  1.0.2</span><a name="a450"></a><br />450   <span class="src-doc">	 */</span><a name="a451"></a><br />451       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodget_language_name">get_language_name</a> <span class="src-sym">(</span><span class="src-sym">)</span><a name="a452"></a><br />452       <span class="src-sym">{</span><a name="a453"></a><br />453           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-id">GESHI_ERROR_NO_SUCH_LANG</span> == <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">_error</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a454"></a><br />454               <span class="src-key">return</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'LANG_NAME'</span><span class="src-sym">]</span> . <span class="src-str">' (Unknown Language)'</span>;<a name="a455"></a><br />455           <span class="src-sym">}</span><a name="a456"></a><br />456           <span class="src-key">return</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'LANG_NAME'</span><span class="src-sym">]</span>;<a name="a457"></a><br />457       <span class="src-sym">}</span><a name="a458"></a><br />458   <a name="a459"></a><br />459       <span class="src-doc">/**</span><a name="a460"></a><br />460   <span class="src-doc">	 * Sets the source code for this object</span><a name="a461"></a><br />461   <span class="src-doc">     * </span><a name="a462"></a><br />462   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The source code to highlight</span><a name="a463"></a><br />463   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a464"></a><br />464   <span class="src-doc">	 */</span><a name="a465"></a><br />465       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_source">set_source</a> <span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">)</span><a name="a466"></a><br />466       <span class="src-sym">{</span><a name="a467"></a><br />467           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-str">''</span> == <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a468"></a><br />468               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span> = <span class="src-id">GESHI_ERROR_NO_INPUT</span>;<a name="a469"></a><br />469           <span class="src-sym">}</span><a name="a470"></a><br />470           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">source</span> = <span class="src-var">$source</span>;<a name="a471"></a><br />471       <span class="src-sym">}</span><a name="a472"></a><br />472   <a name="a473"></a><br />473       <span class="src-doc">/**</span><a name="a474"></a><br />474   <span class="src-doc">	 * Sets the language for this object</span><a name="a475"></a><br />475   <span class="src-doc">     * </span><a name="a476"></a><br />476   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The name of the language to use</span><a name="a477"></a><br />477   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a478"></a><br />478   <span class="src-doc">	 */</span><a name="a479"></a><br />479       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_language">set_language</a> <span class="src-sym">(</span><span class="src-var">$language</span><span class="src-sym">)</span><a name="a480"></a><br />480       <span class="src-sym">{</span><a name="a481"></a><br />481           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span> = <span class="src-id">false</span>;<a name="a482"></a><br />482           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">strict_mode</span> = <span class="src-id">GESHI_NEVER</span>;<a name="a483"></a><br />483           <a name="a484"></a><br />484           <span class="src-var">$language</span> = <a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span><span class="src-str">'#[^a-zA-Z0-9\-_]#'</span><span class="src-sym">,</span> <span class="src-str">''</span><span class="src-sym">,</span> <span class="src-var">$language</span><span class="src-sym">)</span>;<a name="a485"></a><br />485           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language</span> = <a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$language</span><span class="src-sym">)</span>;<a name="a486"></a><br />486           <a name="a487"></a><br />487           <span class="src-var">$file_name</span> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_path</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language</span> . <span class="src-str">'.php'</span>;<a name="a488"></a><br />488           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_readable">is_readable</a><span class="src-sym">(</span><span class="src-var">$file_name</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a489"></a><br />489               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span> = <span class="src-id">GESHI_ERROR_NO_SUCH_LANG</span>;<a name="a490"></a><br />490               <span class="src-key">return</span>;<a name="a491"></a><br />491           <span class="src-sym">}</span><a name="a492"></a><br />492           <span class="src-comm">// Load the language for parsing</span><a name="a493"></a><br />493           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">load_language</span><span class="src-sym">(</span><span class="src-var">$file_name</span><span class="src-sym">)</span>;<a name="a494"></a><br />494       <span class="src-sym">}</span><a name="a495"></a><br />495   <a name="a496"></a><br />496       <span class="src-doc">/**</span><a name="a497"></a><br />497   <span class="src-doc">	 * Sets the path to the directory containing the language files. Note</span><a name="a498"></a><br />498   <span class="src-doc">	 * that this path is relative to the directory of the script that included</span><a name="a499"></a><br />499   <span class="src-doc">	 * geshi.php, NOT geshi.php itself.</span><a name="a500"></a><br />500   <span class="src-doc">     * </span><a name="a501"></a><br />501   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The path to the language directory</span><a name="a502"></a><br />502   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a503"></a><br />503   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@deprecated</span><span class="src-doc"> The path to the language files should now be automatically</span><a name="a504"></a><br />504   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">             detected, so this method should no longer be needed. The</span><a name="a505"></a><br />505   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">             1.1.X branch handles manual setting of the path differently</span><a name="a506"></a><br />506   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">             so this method will disappear in 1.2.0.</span><a name="a507"></a><br />507   <span class="src-doc">	 */</span><a name="a508"></a><br />508       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_language_path">set_language_path</a> <span class="src-sym">(</span><span class="src-var">$path</span><span class="src-sym">)</span><a name="a509"></a><br />509       <span class="src-sym">{</span><a name="a510"></a><br />510           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$path</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a511"></a><br />511             <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_path</span> = <span class="src-sym">(</span><span class="src-str">'/'</span> == <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$path</span><span class="src-sym">,</span> <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$path</span><span class="src-sym">)</span> - <span class="src-num">1</span><span class="src-sym">,</span> <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">)</span> ? <span class="src-var">$path</span> : <span class="src-var">$path</span> . <span class="src-str">'/'</span>;<a name="a512"></a><br />512           <span class="src-sym">}</span><a name="a513"></a><br />513       <span class="src-sym">}</span><a name="a514"></a><br />514   <a name="a515"></a><br />515       <span class="src-doc">/**</span><a name="a516"></a><br />516   <span class="src-doc">	 * Sets the type of header to be used.</span><a name="a517"></a><br />517   <span class="src-doc">     * </span><a name="a518"></a><br />518   <span class="src-doc">     * If GESHI_HEADER_DIV is used, the code is surrounded in a &quot;div&quot;.This</span><a name="a519"></a><br />519   <span class="src-doc">     * means more source code but more control over tab width and line-wrapping.</span><a name="a520"></a><br />520   <span class="src-doc">     * GESHI_HEADER_PRE means that a &quot;pre&quot; is used - less source, but less</span><a name="a521"></a><br />521   <span class="src-doc">     * control. Default is GESHI_HEADER_PRE.</span><a name="a522"></a><br />522   <span class="src-doc">     * </span><a name="a523"></a><br />523   <span class="src-doc">     * From 1.0.7.2, you can use GESHI_HEADER_NONE to specify that no header code</span><a name="a524"></a><br />524   <span class="src-doc">     * should be outputted.</span><a name="a525"></a><br />525   <span class="src-doc">     * </span><a name="a526"></a><br />526   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc"></span><span class="src-doc">The type of header to be used</span><a name="a527"></a><br />527   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a528"></a><br />528   <span class="src-doc">	 */</span><a name="a529"></a><br />529       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_header_type">set_header_type</a> <span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">)</span><a name="a530"></a><br />530       <span class="src-sym">{</span><a name="a531"></a><br />531           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_HEADER_DIV">GESHI_HEADER_DIV</a></span> != <span class="src-var">$type</span> &amp;&amp; <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_HEADER_PRE">GESHI_HEADER_PRE</a></span> != <span class="src-var">$type</span> &amp;&amp; <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_HEADER_NONE">GESHI_HEADER_NONE</a></span> != <span class="src-var">$type</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a532"></a><br />532               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span> = <span class="src-id">GESHI_ERROR_INVALID_HEADER_TYPE</span>;<a name="a533"></a><br />533               <span class="src-key">return</span>;<a name="a534"></a><br />534           <span class="src-sym">}</span><a name="a535"></a><br />535           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">header_type</span> = <span class="src-var">$type</span>;<a name="a536"></a><br />536       <span class="src-sym">}</span><a name="a537"></a><br />537   <a name="a538"></a><br />538       <span class="src-doc">/**</span><a name="a539"></a><br />539   <span class="src-doc">	 * Sets the styles for the code that will be outputted</span><a name="a540"></a><br />540   <span class="src-doc">	 * when this object is parsed. The style should be a</span><a name="a541"></a><br />541   <span class="src-doc">	 * string of valid stylesheet declarations</span><a name="a542"></a><br />542   <span class="src-doc">     * </span><a name="a543"></a><br />543   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"> </span><span class="src-doc">The overall style for the outputted code block</span><a name="a544"></a><br />544   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to merge the styles with the current styles or not</span><a name="a545"></a><br />545   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a546"></a><br />546   <span class="src-doc">	 */</span><a name="a547"></a><br />547       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_overall_style">set_overall_style</a> <span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">,</span> <span class="src-var">$preserve_defaults</span> = <span class="src-id">false</span><span class="src-sym">)</span><a name="a548"></a><br />548       <span class="src-sym">{</span><a name="a549"></a><br />549           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a550"></a><br />550               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">overall_style</span> = <span class="src-var">$style</span>;<a name="a551"></a><br />551           <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a552"></a><br />552               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">overall_style</span> .= <span class="src-var">$style</span>;<a name="a553"></a><br />553           <span class="src-sym">}</span><a name="a554"></a><br />554       <span class="src-sym">}</span><a name="a555"></a><br />555   <a name="a556"></a><br />556       <span class="src-doc">/**</span><a name="a557"></a><br />557   <span class="src-doc">	 * Sets the overall classname for this block of code. This</span><a name="a558"></a><br />558   <span class="src-doc">	 * class can then be used in a stylesheet to style this object's</span><a name="a559"></a><br />559   <span class="src-doc">	 * output</span><a name="a560"></a><br />560   <span class="src-doc">     * </span><a name="a561"></a><br />561   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The class name to use for this block of code</span><a name="a562"></a><br />562   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a563"></a><br />563   <span class="src-doc">	 */</span><a name="a564"></a><br />564       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_overall_class">set_overall_class</a> <span class="src-sym">(</span><span class="src-var">$class</span><span class="src-sym">)</span><a name="a565"></a><br />565       <span class="src-sym">{</span><a name="a566"></a><br />566           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">overall_class</span> = <span class="src-var">$class</span>;<a name="a567"></a><br />567       <span class="src-sym">}</span><a name="a568"></a><br />568   <a name="a569"></a><br />569       <span class="src-doc">/**</span><a name="a570"></a><br />570   <span class="src-doc">	 * Sets the overall id for this block of code. This id can then</span><a name="a571"></a><br />571   <span class="src-doc">	 * be used in a stylesheet to style this object's output</span><a name="a572"></a><br />572   <span class="src-doc">     * </span><a name="a573"></a><br />573   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The ID to use for this block of code</span><a name="a574"></a><br />574   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a575"></a><br />575   <span class="src-doc">	 */</span><a name="a576"></a><br />576       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_overall_id">set_overall_id</a> <span class="src-sym">(</span><span class="src-var">$id</span><span class="src-sym">)</span><a name="a577"></a><br />577       <span class="src-sym">{</span><a name="a578"></a><br />578           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">overall_id</span> = <span class="src-var">$id</span>;<a name="a579"></a><br />579       <span class="src-sym">}</span><a name="a580"></a><br />580   <a name="a581"></a><br />581       <span class="src-doc">/**</span><a name="a582"></a><br />582   <span class="src-doc">     * Sets whether CSS classes should be used to highlight the source. Default</span><a name="a583"></a><br />583   <span class="src-doc">     * is off, calling this method with no arguments will turn it on</span><a name="a584"></a><br />584   <span class="src-doc">     * </span><a name="a585"></a><br />585   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to turn classes on or not</span><a name="a586"></a><br />586   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a587"></a><br />587   <span class="src-doc">     */</span><a name="a588"></a><br />588       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodenable_classes">enable_classes</a> <span class="src-sym">(</span><span class="src-var">$flag</span> = <span class="src-id">true</span><span class="src-sym">)</span><a name="a589"></a><br />589       <span class="src-sym">{</span><a name="a590"></a><br />590           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span> = <span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span> ? <span class="src-id">true</span> : <span class="src-id">false</span>;<a name="a591"></a><br />591       <span class="src-sym">}</span><a name="a592"></a><br />592   <a name="a593"></a><br />593       <span class="src-doc">/**</span><a name="a594"></a><br />594   <span class="src-doc">	 * Sets the style for the actual code. This should be a string</span><a name="a595"></a><br />595   <span class="src-doc">	 * containing valid stylesheet declarations. If $preserve_defaults is</span><a name="a596"></a><br />596   <span class="src-doc">	 * true, then styles are merged with the default styles, with the</span><a name="a597"></a><br />597   <span class="src-doc">	 * user defined styles having priority</span><a name="a598"></a><br />598   <span class="src-doc">	 *</span><a name="a599"></a><br />599   <span class="src-doc">	 * Note: Use this method to override any style changes you made to</span><a name="a600"></a><br />600   <span class="src-doc">	 * the line numbers if you are using line numbers, else the line of</span><a name="a601"></a><br />601   <span class="src-doc">	 * code will have the same style as the line number! Consult the</span><a name="a602"></a><br />602   <span class="src-doc">	 * GeSHi documentation for more information about this.</span><a name="a603"></a><br />603   <span class="src-doc">     * </span><a name="a604"></a><br />604   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"> </span><span class="src-doc">The style to use for actual code</span><a name="a605"></a><br />605   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to merge the current styles with the new styles</span><a name="a606"></a><br />606   <span class="src-doc">	 */</span><a name="a607"></a><br />607       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_code_style">set_code_style</a> <span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">,</span> <span class="src-var">$preserve_defaults</span> = <span class="src-id">false</span><span class="src-sym">)</span><a name="a608"></a><br />608       <span class="src-sym">{</span><a name="a609"></a><br />609           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a610"></a><br />610               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">code_style</span> = <span class="src-var">$style</span>;<a name="a611"></a><br />611           <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a612"></a><br />612               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">code_style</span> .= <span class="src-var">$style</span>;<a name="a613"></a><br />613           <span class="src-sym">}</span><a name="a614"></a><br />614       <span class="src-sym">}</span><a name="a615"></a><br />615   <a name="a616"></a><br />616       <span class="src-doc">/**</span><a name="a617"></a><br />617   <span class="src-doc">	 * Sets the styles for the line numbers.</span><a name="a618"></a><br />618   <span class="src-doc">     * </span><a name="a619"></a><br />619   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The style for the line numbers that are &quot;normal&quot;</span><a name="a620"></a><br />620   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">boolean</span><span class="src-doc"></span><span class="src-doc">If a string, this is the style of the line</span><a name="a621"></a><br />621   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">        numbers that are &quot;fancy&quot;, otherwise if boolean then this</span><a name="a622"></a><br />622   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">        defines whether the normal styles should be merged with the</span><a name="a623"></a><br />623   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">        new normal styles or not</span><a name="a624"></a><br />624   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">If set, is the flag for whether to merge the &quot;fancy&quot;</span><a name="a625"></a><br />625   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">        styles with the current styles or not</span><a name="a626"></a><br />626   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.2</span><a name="a627"></a><br />627   <span class="src-doc">	 */</span><a name="a628"></a><br />628       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_line_style">set_line_style</a> <span class="src-sym">(</span><span class="src-var">$style1</span><span class="src-sym">,</span> <span class="src-var">$style2</span> = <span class="src-str">''</span><span class="src-sym">,</span> <span class="src-var">$preserve_defaults</span> = <span class="src-id">false</span><span class="src-sym">)</span><a name="a629"></a><br />629       <span class="src-sym">{</span><a name="a630"></a><br />630           <span class="src-key">if</span> <span class="src-sym">(</span><a href="http://www.php.net/is_bool">is_bool</a><span class="src-sym">(</span><span class="src-var">$style2</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a631"></a><br />631               <span class="src-var">$preserve_defaults</span> = <span class="src-var">$style2</span>;<a name="a632"></a><br />632               <span class="src-var">$style2</span> = <span class="src-str">''</span>;<a name="a633"></a><br />633           <span class="src-sym">}</span><a name="a634"></a><br />634           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a635"></a><br />635               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_style1</span> = <span class="src-var">$style1</span>;<a name="a636"></a><br />636               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_style2</span> = <span class="src-var">$style2</span>;<a name="a637"></a><br />637           <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a638"></a><br />638               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_style1</span> .= <span class="src-var">$style1</span>;<a name="a639"></a><br />639               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_style2</span> .= <span class="src-var">$style2</span>;<a name="a640"></a><br />640           <span class="src-sym">}</span><a name="a641"></a><br />641       <span class="src-sym">}</span><a name="a642"></a><br />642   <a name="a643"></a><br />643       <span class="src-doc">/**</span><a name="a644"></a><br />644   <span class="src-doc">	 * Sets whether line numbers should be displayed.</span><a name="a645"></a><br />645   <span class="src-doc">     * </span><a name="a646"></a><br />646   <span class="src-doc">     * Valid values for the first parameter are:</span><a name="a647"></a><br />647   <span class="src-doc">     * </span><a name="a648"></a><br />648   <span class="src-doc">     * &lt;ul&gt;</span><a name="a649"></a><br />649   <span class="src-doc">     *   &lt;li&gt;&lt;b&gt;GESHI_NO_LINE_NUMBERS&lt;/b&gt;: Line numbers will not be displayed&lt;/li&gt;</span><a name="a650"></a><br />650   <span class="src-doc">	 *   &lt;li&gt;&lt;b&gt;GESHI_NORMAL_LINE_NUMBERS&lt;/b&gt;: Line numbers will be displayed&lt;/li&gt;</span><a name="a651"></a><br />651   <span class="src-doc">     *   &lt;li&gt;&lt;b&gt;GESHI_FANCY_LINE_NUMBERS&lt;/b&gt;: Fancy line numbers will be displayed&lt;/li&gt;</span><a name="a652"></a><br />652   <span class="src-doc">     * &lt;/ul&gt;</span><a name="a653"></a><br />653   <span class="src-doc">     * </span><a name="a654"></a><br />654   <span class="src-doc">     * For fancy line numbers, the second parameter is used to signal which lines</span><a name="a655"></a><br />655   <span class="src-doc">     * are to be fancy. For example, if the value of this parameter is 5 then every</span><a name="a656"></a><br />656   <span class="src-doc">     * 5th line will be fancy.</span><a name="a657"></a><br />657   <span class="src-doc">     * </span><a name="a658"></a><br />658   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc"></span><span class="src-doc">How line numbers should be displayed</span><a name="a659"></a><br />659   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc"></span><span class="src-doc">Defines which lines are fancy</span><a name="a660"></a><br />660   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a661"></a><br />661   <span class="src-doc">	 */</span><a name="a662"></a><br />662       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodenable_line_numbers">enable_line_numbers</a> <span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">,</span> <span class="src-var">$nth_row</span> = <span class="src-num">5</span><span class="src-sym">)</span><a name="a663"></a><br />663       <span class="src-sym">{</span><a name="a664"></a><br />664           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_NO_LINE_NUMBERS">GESHI_NO_LINE_NUMBERS</a></span> != <span class="src-var">$flag</span> &amp;&amp; <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_NORMAL_LINE_NUMBERS">GESHI_NORMAL_LINE_NUMBERS</a></span> != <span class="src-var">$flag</span><a name="a665"></a><br />665               &amp;&amp; <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_FANCY_LINE_NUMBERS">GESHI_FANCY_LINE_NUMBERS</a></span> != <span class="src-var">$flag</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a666"></a><br />666               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span> = <span class="src-id">GESHI_ERROR_INVALID_LINE_NUMBER_TYPE</span>;<a name="a667"></a><br />667           <span class="src-sym">}</span><a name="a668"></a><br />668           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_numbers</span> = <span class="src-var">$flag</span>;<a name="a669"></a><br />669           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_nth_row</span> = <span class="src-var">$nth_row</span>;<a name="a670"></a><br />670       <span class="src-sym">}</span><a name="a671"></a><br />671   <a name="a672"></a><br />672       <span class="src-doc">/**</span><a name="a673"></a><br />673   <span class="src-doc">	 * Sets the style for a keyword group. If $preserve_defaults is</span><a name="a674"></a><br />674   <span class="src-doc">	 * true, then styles are merged with the default styles, with the</span><a name="a675"></a><br />675   <span class="src-doc">	 * user defined styles having priority</span><a name="a676"></a><br />676   <span class="src-doc">     * </span><a name="a677"></a><br />677   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc">    </span><span class="src-doc">The key of the keyword group to change the styles of</span><a name="a678"></a><br />678   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"> </span><span class="src-doc">The style to make the keywords</span><a name="a679"></a><br />679   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to merge the new styles with the old or just</span><a name="a680"></a><br />680   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">                to overwrite them</span><a name="a681"></a><br />681   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a682"></a><br />682   <span class="src-doc">	 */</span><a name="a683"></a><br />683       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_keyword_group_style">set_keyword_group_style</a> <span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span> <span class="src-var">$style</span><span class="src-sym">,</span> <span class="src-var">$preserve_defaults</span> = <span class="src-id">false</span><span class="src-sym">)</span><a name="a684"></a><br />684       <span class="src-sym">{</span><a name="a685"></a><br />685           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a686"></a><br />686               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-var">$style</span>;<a name="a687"></a><br />687           <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a688"></a><br />688               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> .= <span class="src-var">$style</span>;<a name="a689"></a><br />689           <span class="src-sym">}</span><a name="a690"></a><br />690       <span class="src-sym">}</span><a name="a691"></a><br />691   <a name="a692"></a><br />692       <span class="src-doc">/**</span><a name="a693"></a><br />693   <span class="src-doc">	 * Turns highlighting on/off for a keyword group</span><a name="a694"></a><br />694   <span class="src-doc">     * </span><a name="a695"></a><br />695   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc">    </span><span class="src-doc">The key of the keyword group to turn on or off</span><a name="a696"></a><br />696   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to turn highlighting for that group on or off</span><a name="a697"></a><br />697   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a698"></a><br />698   <span class="src-doc">	 */</span><a name="a699"></a><br />699       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_keyword_group_highlighting">set_keyword_group_highlighting</a> <span class="src-sym">(</span> <span class="src-var">$key</span><span class="src-sym">,</span> <span class="src-var">$flag</span> = <span class="src-id">true</span> <span class="src-sym">)</span><a name="a700"></a><br />700       <span class="src-sym">{</span><a name="a701"></a><br />701           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span> ? <span class="src-id">true</span> : <span class="src-id">false</span>;<a name="a702"></a><br />702       <span class="src-sym">}</span><a name="a703"></a><br />703   <a name="a704"></a><br />704       <span class="src-doc">/**</span><a name="a705"></a><br />705   <span class="src-doc">	 * Sets the styles for comment groups.  If $preserve_defaults is</span><a name="a706"></a><br />706   <span class="src-doc">	 * true, then styles are merged with the default styles, with the</span><a name="a707"></a><br />707   <span class="src-doc">	 * user defined styles having priority</span><a name="a708"></a><br />708   <span class="src-doc">     * </span><a name="a709"></a><br />709   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc">    </span><span class="src-doc">The key of the comment group to change the styles of</span><a name="a710"></a><br />710   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"> </span><span class="src-doc">The style to make the comments</span><a name="a711"></a><br />711   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to merge the new styles with the old or just</span><a name="a712"></a><br />712   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">                to overwrite them</span><a name="a713"></a><br />713   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a714"></a><br />714   <span class="src-doc">	 */</span><a name="a715"></a><br />715       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_comments_style">set_comments_style</a> <span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span> <span class="src-var">$style</span><span class="src-sym">,</span> <span class="src-var">$preserve_defaults</span> = <span class="src-id">false</span><span class="src-sym">)</span><a name="a716"></a><br />716       <span class="src-sym">{</span><a name="a717"></a><br />717           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a718"></a><br />718               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-var">$style</span>;<a name="a719"></a><br />719           <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a720"></a><br />720               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> .= <span class="src-var">$style</span>;<a name="a721"></a><br />721           <span class="src-sym">}</span><a name="a722"></a><br />722       <span class="src-sym">}</span><a name="a723"></a><br />723   <a name="a724"></a><br />724       <span class="src-doc">/**</span><a name="a725"></a><br />725   <span class="src-doc">	 * Turns highlighting on/off for comment groups</span><a name="a726"></a><br />726   <span class="src-doc">     * </span><a name="a727"></a><br />727   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc">    </span><span class="src-doc">The key of the comment group to turn on or off</span><a name="a728"></a><br />728   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to turn highlighting for that group on or off</span><a name="a729"></a><br />729   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a730"></a><br />730   <span class="src-doc">	 */</span><a name="a731"></a><br />731       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_comments_highlighting">set_comments_highlighting</a> <span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span> <span class="src-var">$flag</span> = <span class="src-id">true</span><span class="src-sym">)</span><a name="a732"></a><br />732       <span class="src-sym">{</span><a name="a733"></a><br />733           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span> ? <span class="src-id">true</span> : <span class="src-id">false</span>;<a name="a734"></a><br />734       <span class="src-sym">}</span><a name="a735"></a><br />735   <a name="a736"></a><br />736       <span class="src-doc">/**</span><a name="a737"></a><br />737   <span class="src-doc">	 * Sets the styles for escaped characters. If $preserve_defaults is</span><a name="a738"></a><br />738   <span class="src-doc">	 * true, then styles are merged with the default styles, with the</span><a name="a739"></a><br />739   <span class="src-doc">	 * user defined styles having priority</span><a name="a740"></a><br />740   <span class="src-doc">     * </span><a name="a741"></a><br />741   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"> </span><span class="src-doc">The style to make the escape characters</span><a name="a742"></a><br />742   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to merge the new styles with the old or just</span><a name="a743"></a><br />743   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">                to overwrite them</span><a name="a744"></a><br />744   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a745"></a><br />745   <span class="src-doc">	 */</span><a name="a746"></a><br />746       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_escape_characters_style">set_escape_characters_style</a> <span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">,</span> <span class="src-var">$preserve_defaults</span> = <span class="src-id">false</span><span class="src-sym">)</span><a name="a747"></a><br />747       <span class="src-sym">{</span><a name="a748"></a><br />748           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a749"></a><br />749               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> = <span class="src-var">$style</span>;<a name="a750"></a><br />750           <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a751"></a><br />751               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> .= <span class="src-var">$style</span>;<a name="a752"></a><br />752           <span class="src-sym">}</span><a name="a753"></a><br />753       <span class="src-sym">}</span><a name="a754"></a><br />754   <a name="a755"></a><br />755       <span class="src-doc">/**</span><a name="a756"></a><br />756   <span class="src-doc">	 * Turns highlighting on/off for escaped characters</span><a name="a757"></a><br />757   <span class="src-doc">     * </span><a name="a758"></a><br />758   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to turn highlighting for escape characters on or off</span><a name="a759"></a><br />759   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a760"></a><br />760   <span class="src-doc">	 */</span><a name="a761"></a><br />761       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_escape_characters_highlighting">set_escape_characters_highlighting</a> <span class="src-sym">(</span><span class="src-var">$flag</span> = <span class="src-id">true</span><span class="src-sym">)</span><a name="a762"></a><br />762       <span class="src-sym">{</span><a name="a763"></a><br />763           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span> = <span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span> ? <span class="src-id">true</span> : <span class="src-id">false</span>;<a name="a764"></a><br />764       <span class="src-sym">}</span><a name="a765"></a><br />765   <a name="a766"></a><br />766       <span class="src-doc">/**</span><a name="a767"></a><br />767   <span class="src-doc">	 * Sets the styles for brackets. If $preserve_defaults is</span><a name="a768"></a><br />768   <span class="src-doc">	 * true, then styles are merged with the default styles, with the</span><a name="a769"></a><br />769   <span class="src-doc">	 * user defined styles having priority</span><a name="a770"></a><br />770   <span class="src-doc">	 *</span><a name="a771"></a><br />771   <span class="src-doc">	 * This method is DEPRECATED: use set_symbols_style instead.</span><a name="a772"></a><br />772   <span class="src-doc">	 * This method will be removed in 1.2.X</span><a name="a773"></a><br />773   <span class="src-doc">     * </span><a name="a774"></a><br />774   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"> </span><span class="src-doc">The style to make the brackets</span><a name="a775"></a><br />775   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to merge the new styles with the old or just</span><a name="a776"></a><br />776   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">                to overwrite them</span><a name="a777"></a><br />777   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a778"></a><br />778   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@deprecated</span><span class="src-doc"> In favour of set_symbols_style</span><a name="a779"></a><br />779   <span class="src-doc">	 */</span><a name="a780"></a><br />780       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_brackets_style">set_brackets_style</a> <span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">,</span> <span class="src-var">$preserve_defaults</span> = <span class="src-id">false</span><span class="src-sym">)</span><a name="a781"></a><br />781       <span class="src-sym">{</span><a name="a782"></a><br />782           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a783"></a><br />783               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> = <span class="src-var">$style</span>;<a name="a784"></a><br />784           <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a785"></a><br />785               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> .= <span class="src-var">$style</span>;<a name="a786"></a><br />786           <span class="src-sym">}</span><a name="a787"></a><br />787       <span class="src-sym">}</span><a name="a788"></a><br />788   <a name="a789"></a><br />789       <span class="src-doc">/**</span><a name="a790"></a><br />790   <span class="src-doc">	 * Turns highlighting on/off for brackets</span><a name="a791"></a><br />791   <span class="src-doc">	 *</span><a name="a792"></a><br />792   <span class="src-doc">	 * This method is DEPRECATED: use set_symbols_highlighting instead.</span><a name="a793"></a><br />793   <span class="src-doc">	 * This method will be remove in 1.2.X</span><a name="a794"></a><br />794   <span class="src-doc">     * </span><a name="a795"></a><br />795   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to turn highlighting for brackets on or off</span><a name="a796"></a><br />796   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a797"></a><br />797   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@deprecated</span><span class="src-doc"> In favour of set_symbols_highlighting</span><a name="a798"></a><br />798   <span class="src-doc">	 */</span><a name="a799"></a><br />799       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_brackets_highlighting">set_brackets_highlighting</a> <span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span><a name="a800"></a><br />800       <span class="src-sym">{</span><a name="a801"></a><br />801           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span> = <span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span> ? <span class="src-id">true</span> : <span class="src-id">false</span>;<a name="a802"></a><br />802       <span class="src-sym">}</span><a name="a803"></a><br />803   <a name="a804"></a><br />804       <span class="src-doc">/**</span><a name="a805"></a><br />805   <span class="src-doc">	 * Sets the styles for symbols. If $preserve_defaults is</span><a name="a806"></a><br />806   <span class="src-doc">	 * true, then styles are merged with the default styles, with the</span><a name="a807"></a><br />807   <span class="src-doc">	 * user defined styles having priority</span><a name="a808"></a><br />808   <span class="src-doc">     * </span><a name="a809"></a><br />809   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"> </span><span class="src-doc">The style to make the symbols</span><a name="a810"></a><br />810   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to merge the new styles with the old or just</span><a name="a811"></a><br />811   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">                to overwrite them</span><a name="a812"></a><br />812   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.1</span><a name="a813"></a><br />813   <span class="src-doc">	 */</span><a name="a814"></a><br />814       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_symbols_style">set_symbols_style</a> <span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">,</span> <span class="src-var">$preserve_defaults</span> = <span class="src-id">false</span><span class="src-sym">)</span><a name="a815"></a><br />815       <span class="src-sym">{</span><a name="a816"></a><br />816           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a817"></a><br />817               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'SYMBOLS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> = <span class="src-var">$style</span>;<a name="a818"></a><br />818           <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a819"></a><br />819               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'SYMBOLS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> .= <span class="src-var">$style</span>;<a name="a820"></a><br />820           <span class="src-sym">}</span><a name="a821"></a><br />821           <span class="src-comm">// For backward compatibility</span><a name="a822"></a><br />822           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../core/GeSHi.html#methodset_brackets_style">set_brackets_style</a> <span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">,</span> <span class="src-var">$preserve_defaults</span><span class="src-sym">)</span>;<a name="a823"></a><br />823       <span class="src-sym">}</span><a name="a824"></a><br />824   <a name="a825"></a><br />825       <span class="src-doc">/**</span><a name="a826"></a><br />826   <span class="src-doc">	 * Turns highlighting on/off for symbols</span><a name="a827"></a><br />827   <span class="src-doc">     * </span><a name="a828"></a><br />828   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to turn highlighting for symbols on or off</span><a name="a829"></a><br />829   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a830"></a><br />830   <span class="src-doc">	 */</span><a name="a831"></a><br />831       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_symbols_highlighting">set_symbols_highlighting</a> <span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span><a name="a832"></a><br />832       <span class="src-sym">{</span><a name="a833"></a><br />833           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'SYMBOLS'</span><span class="src-sym">]</span> = <span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span> ? <span class="src-id">true</span> : <span class="src-id">false</span>;<a name="a834"></a><br />834           <span class="src-comm">// For backward compatibility</span><a name="a835"></a><br />835           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../core/GeSHi.html#methodset_brackets_highlighting">set_brackets_highlighting</a> <span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>;<a name="a836"></a><br />836       <span class="src-sym">}</span><a name="a837"></a><br />837   <a name="a838"></a><br />838       <span class="src-doc">/**</span><a name="a839"></a><br />839   <span class="src-doc">	 * Sets the styles for strings. If $preserve_defaults is</span><a name="a840"></a><br />840   <span class="src-doc">	 * true, then styles are merged with the default styles, with the</span><a name="a841"></a><br />841   <span class="src-doc">	 * user defined styles having priority</span><a name="a842"></a><br />842   <span class="src-doc">     * </span><a name="a843"></a><br />843   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"> </span><span class="src-doc">The style to make the escape characters</span><a name="a844"></a><br />844   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to merge the new styles with the old or just</span><a name="a845"></a><br />845   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">                to overwrite them</span><a name="a846"></a><br />846   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a847"></a><br />847   <span class="src-doc">	 */</span><a name="a848"></a><br />848       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_strings_style">set_strings_style</a> <span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">,</span> <span class="src-var">$preserve_defaults</span> = <span class="src-id">false</span><span class="src-sym">)</span><a name="a849"></a><br />849       <span class="src-sym">{</span><a name="a850"></a><br />850           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a851"></a><br />851               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> = <span class="src-var">$style</span>;<a name="a852"></a><br />852           <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a853"></a><br />853               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> .= <span class="src-var">$style</span>;<a name="a854"></a><br />854           <span class="src-sym">}</span><a name="a855"></a><br />855       <span class="src-sym">}</span><a name="a856"></a><br />856   <a name="a857"></a><br />857       <span class="src-doc">/**</span><a name="a858"></a><br />858   <span class="src-doc">	 * Turns highlighting on/off for strings</span><a name="a859"></a><br />859   <span class="src-doc">     * </span><a name="a860"></a><br />860   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to turn highlighting for strings on or off</span><a name="a861"></a><br />861   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a862"></a><br />862   <span class="src-doc">	 */</span><a name="a863"></a><br />863       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_strings_highlighting">set_strings_highlighting</a> <span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span><a name="a864"></a><br />864       <span class="src-sym">{</span><a name="a865"></a><br />865           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span> = <span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span> ? <span class="src-id">true</span> : <span class="src-id">false</span>;<a name="a866"></a><br />866       <span class="src-sym">}</span><a name="a867"></a><br />867   <a name="a868"></a><br />868       <span class="src-doc">/**</span><a name="a869"></a><br />869   <span class="src-doc">	 * Sets the styles for numbers. If $preserve_defaults is</span><a name="a870"></a><br />870   <span class="src-doc">	 * true, then styles are merged with the default styles, with the</span><a name="a871"></a><br />871   <span class="src-doc">	 * user defined styles having priority</span><a name="a872"></a><br />872   <span class="src-doc">     * </span><a name="a873"></a><br />873   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"> </span><span class="src-doc">The style to make the numbers</span><a name="a874"></a><br />874   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to merge the new styles with the old or just</span><a name="a875"></a><br />875   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">                to overwrite them</span><a name="a876"></a><br />876   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a877"></a><br />877   <span class="src-doc">	 */</span><a name="a878"></a><br />878       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_numbers_style">set_numbers_style</a> <span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">,</span> <span class="src-var">$preserve_defaults</span> = <span class="src-id">false</span><span class="src-sym">)</span><a name="a879"></a><br />879       <span class="src-sym">{</span><a name="a880"></a><br />880           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a881"></a><br />881               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> = <span class="src-var">$style</span>;<a name="a882"></a><br />882           <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a883"></a><br />883               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> .= <span class="src-var">$style</span>;<a name="a884"></a><br />884           <span class="src-sym">}</span><a name="a885"></a><br />885       <span class="src-sym">}</span><a name="a886"></a><br />886   <a name="a887"></a><br />887       <span class="src-doc">/**</span><a name="a888"></a><br />888   <span class="src-doc">	 * Turns highlighting on/off for numbers</span><a name="a889"></a><br />889   <span class="src-doc">     * </span><a name="a890"></a><br />890   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to turn highlighting for numbers on or off</span><a name="a891"></a><br />891   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a892"></a><br />892   <span class="src-doc">	 */</span><a name="a893"></a><br />893       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_numbers_highlighting">set_numbers_highlighting</a> <span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span><a name="a894"></a><br />894       <span class="src-sym">{</span><a name="a895"></a><br />895           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span> = <span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span> ? <span class="src-id">true</span> : <span class="src-id">false</span>;<a name="a896"></a><br />896       <span class="src-sym">}</span><a name="a897"></a><br />897   <a name="a898"></a><br />898       <span class="src-doc">/**</span><a name="a899"></a><br />899   <span class="src-doc">	 * Sets the styles for methods. $key is a number that references the</span><a name="a900"></a><br />900   <span class="src-doc">	 * appropriate &quot;object splitter&quot; - see the language file for the language</span><a name="a901"></a><br />901   <span class="src-doc">	 * you are highlighting to get this number. If $preserve_defaults is</span><a name="a902"></a><br />902   <span class="src-doc">	 * true, then styles are merged with the default styles, with the</span><a name="a903"></a><br />903   <span class="src-doc">	 * user defined styles having priority</span><a name="a904"></a><br />904   <span class="src-doc">     * </span><a name="a905"></a><br />905   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc">    </span><span class="src-doc">The key of the object splitter to change the styles of</span><a name="a906"></a><br />906   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"> </span><span class="src-doc">The style to make the methods</span><a name="a907"></a><br />907   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to merge the new styles with the old or just</span><a name="a908"></a><br />908   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">                to overwrite them</span><a name="a909"></a><br />909   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a910"></a><br />910   <span class="src-doc">	 */</span><a name="a911"></a><br />911       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_methods_style">set_methods_style</a> <span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span> <span class="src-var">$style</span><span class="src-sym">,</span> <span class="src-var">$preserve_defaults</span> = <span class="src-id">false</span><span class="src-sym">)</span><a name="a912"></a><br />912       <span class="src-sym">{</span><a name="a913"></a><br />913           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a914"></a><br />914               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'METHODS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-var">$style</span>;<a name="a915"></a><br />915           <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a916"></a><br />916               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'METHODS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> .= <span class="src-var">$style</span>;<a name="a917"></a><br />917           <span class="src-sym">}</span><a name="a918"></a><br />918       <span class="src-sym">}</span><a name="a919"></a><br />919   <a name="a920"></a><br />920       <span class="src-doc">/**</span><a name="a921"></a><br />921   <span class="src-doc">	 * Turns highlighting on/off for methods</span><a name="a922"></a><br />922   <span class="src-doc">     * </span><a name="a923"></a><br />923   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to turn highlighting for methods on or off</span><a name="a924"></a><br />924   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a925"></a><br />925   <span class="src-doc">	 */</span><a name="a926"></a><br />926       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_methods_highlighting">set_methods_highlighting</a> <span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span><a name="a927"></a><br />927       <span class="src-sym">{</span><a name="a928"></a><br />928           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'METHODS'</span><span class="src-sym">]</span> = <span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span> ? <span class="src-id">true</span> : <span class="src-id">false</span>;<a name="a929"></a><br />929       <span class="src-sym">}</span><a name="a930"></a><br />930   <a name="a931"></a><br />931       <span class="src-doc">/**</span><a name="a932"></a><br />932   <span class="src-doc">	 * Sets the styles for regexps. If $preserve_defaults is</span><a name="a933"></a><br />933   <span class="src-doc">	 * true, then styles are merged with the default styles, with the</span><a name="a934"></a><br />934   <span class="src-doc">	 * user defined styles having priority</span><a name="a935"></a><br />935   <span class="src-doc">     * </span><a name="a936"></a><br />936   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"> </span><span class="src-doc">The style to make the regular expression matches</span><a name="a937"></a><br />937   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to merge the new styles with the old or just</span><a name="a938"></a><br />938   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">                to overwrite them</span><a name="a939"></a><br />939   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a940"></a><br />940   <span class="src-doc">	 */</span><a name="a941"></a><br />941       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_regexps_style">set_regexps_style</a> <span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span> <span class="src-var">$style</span><span class="src-sym">,</span> <span class="src-var">$preserve_defaults</span> = <span class="src-id">false</span><span class="src-sym">)</span><a name="a942"></a><br />942       <span class="src-sym">{</span><a name="a943"></a><br />943           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a944"></a><br />944               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-var">$style</span>;<a name="a945"></a><br />945           <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a946"></a><br />946               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> .= <span class="src-var">$style</span>;<a name="a947"></a><br />947           <span class="src-sym">}</span><a name="a948"></a><br />948       <span class="src-sym">}</span><a name="a949"></a><br />949   <a name="a950"></a><br />950       <span class="src-doc">/**</span><a name="a951"></a><br />951   <span class="src-doc">	 * Turns highlighting on/off for regexps</span><a name="a952"></a><br />952   <span class="src-doc">     * </span><a name="a953"></a><br />953   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc">    </span><span class="src-doc">The key of the regular expression group to turn on or off</span><a name="a954"></a><br />954   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to turn highlighting for the regular expression group on or off</span><a name="a955"></a><br />955   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a956"></a><br />956   <span class="src-doc">	 */</span><a name="a957"></a><br />957       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_regexps_highlighting">set_regexps_highlighting</a> <span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span> <span class="src-var">$flag</span><span class="src-sym">)</span><a name="a958"></a><br />958       <span class="src-sym">{</span><a name="a959"></a><br />959           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span> ? <span class="src-id">true</span> : <span class="src-id">false</span>;<a name="a960"></a><br />960       <span class="src-sym">}</span><a name="a961"></a><br />961   <a name="a962"></a><br />962       <span class="src-doc">/**</span><a name="a963"></a><br />963   <span class="src-doc">	 * Sets whether a set of keywords are checked for in a case sensitive manner</span><a name="a964"></a><br />964   <span class="src-doc">     * </span><a name="a965"></a><br />965   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc"></span><span class="src-doc">The key of the keyword group to change the case sensitivity of</span><a name="a966"></a><br />966   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to check in a case sensitive manner or not</span><a name="a967"></a><br />967   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a968"></a><br />968   <span class="src-doc">	 */</span><a name="a969"></a><br />969       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_case_sensitivity">set_case_sensitivity</a> <span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span> <span class="src-var">$case</span><span class="src-sym">)</span><a name="a970"></a><br />970       <span class="src-sym">{</span><a name="a971"></a><br />971           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CASE_SENSITIVE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-sym">(</span><span class="src-var">$case</span><span class="src-sym">)</span> ? <span class="src-id">true</span> : <span class="src-id">false</span>;<a name="a972"></a><br />972       <span class="src-sym">}</span><a name="a973"></a><br />973   <a name="a974"></a><br />974       <span class="src-doc">/**</span><a name="a975"></a><br />975   <span class="src-doc">	 * Sets the case that keywords should use when found. Use the constants:</span><a name="a976"></a><br />976   <span class="src-doc">     * </span><a name="a977"></a><br />977   <span class="src-doc">     * &lt;ul&gt;</span><a name="a978"></a><br />978   <span class="src-doc">	 *   &lt;li&gt;&lt;b&gt;GESHI_CAPS_NO_CHANGE&lt;/b&gt;: leave keywords as-is&lt;/li&gt;</span><a name="a979"></a><br />979   <span class="src-doc">	 *   &lt;li&gt;&lt;b&gt;GESHI_CAPS_UPPER&lt;/b&gt;: convert all keywords to uppercase where found&lt;/li&gt;</span><a name="a980"></a><br />980   <span class="src-doc">	 *   &lt;li&gt;&lt;b&gt;GESHI_CAPS_LOWER&lt;/b&gt;: convert all keywords to lowercase where found&lt;/li&gt;</span><a name="a981"></a><br />981   <span class="src-doc">     * &lt;/ul&gt;</span><a name="a982"></a><br />982   <span class="src-doc">     * </span><a name="a983"></a><br />983   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc"></span><span class="src-doc">A constant specifying what to do with matched keywords</span><a name="a984"></a><br />984   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.1</span><a name="a985"></a><br />985   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@todo</span><span class="src-doc">  Error check the passed value</span><a name="a986"></a><br />986   <span class="src-doc">	 */</span><a name="a987"></a><br />987       <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_case_keywords">set_case_keywords</a> <span class="src-sym">(</span><span class="src-var">$case</span><span class="src-sym">)</span><a name="a988"></a><br />988       <span class="src-sym">{</span><a name="a989"></a><br />989           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CASE_KEYWORDS'</span><span class="src-sym">]</span> = <span class="src-var">$case</span>;<a name="a990"></a><br />990       <span class="src-sym">}</span><a name="a991"></a><br />991   <a name="a992"></a><br />992       <span class="src-doc">/**</span><a name="a993"></a><br />993   <span class="src-doc">	 * Sets how many spaces a tab is substituted for</span><a name="a994"></a><br />994   <span class="src-doc">     * </span><a name="a995"></a><br />995   <span class="src-doc">     * Widths below zero are ignored</span><a name="a996"></a><br />996   <span class="src-doc">     * </span><a name="a997"></a><br />997   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc"></span><span class="src-doc">The tab width</span><a name="a998"></a><br />998   <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a999"></a><br />999   <span class="src-doc">	 */</span><a name="a1000"></a><br />1000      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_tab_width">set_tab_width</a> <span class="src-sym">(</span><span class="src-var">$width</span><span class="src-sym">)</span><a name="a1001"></a><br />1001      <span class="src-sym">{</span><a name="a1002"></a><br />1002          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">tab_width</span> = <a href="http://www.php.net/intval">intval</a><span class="src-sym">(</span><span class="src-var">$width</span><span class="src-sym">)</span>;<a name="a1003"></a><br />1003      <span class="src-sym">}</span><a name="a1004"></a><br />1004  <a name="a1005"></a><br />1005      <span class="src-doc">/**</span><a name="a1006"></a><br />1006  <span class="src-doc">	 * Enables/disables strict highlighting. Default is off, calling this</span><a name="a1007"></a><br />1007  <span class="src-doc">	 * method without parameters will turn it on. See documentation</span><a name="a1008"></a><br />1008  <span class="src-doc">	 * for more details on strict mode and where to use it.</span><a name="a1009"></a><br />1009  <span class="src-doc">     * </span><a name="a1010"></a><br />1010  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to enable strict mode or not</span><a name="a1011"></a><br />1011  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a1012"></a><br />1012  <span class="src-doc">	 */</span><a name="a1013"></a><br />1013      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodenable_strict_mode">enable_strict_mode</a> <span class="src-sym">(</span><span class="src-var">$mode</span> = <span class="src-id">true</span><span class="src-sym">)</span><a name="a1014"></a><br />1014      <span class="src-sym">{</span><a name="a1015"></a><br />1015          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-id">GESHI_MAYBE</span> == <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STRICT_MODE_APPLIES'</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1016"></a><br />1016            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">strict_mode</span> = <span class="src-sym">(</span><span class="src-var">$mode</span><span class="src-sym">)</span> ? <span class="src-id">true</span> : <span class="src-id">false</span>;<a name="a1017"></a><br />1017          <span class="src-sym">}</span><a name="a1018"></a><br />1018      <span class="src-sym">}</span><a name="a1019"></a><br />1019  <a name="a1020"></a><br />1020      <span class="src-doc">/**</span><a name="a1021"></a><br />1021  <span class="src-doc">	 * Disables all highlighting</span><a name="a1022"></a><br />1022  <span class="src-doc">     * </span><a name="a1023"></a><br />1023  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a1024"></a><br />1024  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@todo</span><span class="src-doc"> Rewrite with an array traversal</span><a name="a1025"></a><br />1025  <span class="src-doc">	 */</span><a name="a1026"></a><br />1026      <span class="src-key">function</span> <a href="../core/GeSHi.html#methoddisable_highlighting">disable_highlighting</a> <span class="src-sym">(</span><span class="src-sym">)</span><a name="a1027"></a><br />1027      <span class="src-sym">{</span><a name="a1028"></a><br />1028          <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span> <span class="src-key">as</span> <span class="src-var">$key</span> =&gt; <span class="src-var">$value</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1029"></a><br />1029              <span class="src-key">if</span> <span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1030"></a><br />1030                  <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$value</span> <span class="src-key">as</span> <span class="src-var">$k</span> =&gt; <span class="src-var">$v</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1031"></a><br />1031                      <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span> = <span class="src-id">false</span>;<a name="a1032"></a><br />1032                  <span class="src-sym">}</span><a name="a1033"></a><br />1033              <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1034"></a><br />1034                  <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-id">false</span>;<a name="a1035"></a><br />1035              <span class="src-sym">}</span><a name="a1036"></a><br />1036          <span class="src-sym">}</span><a name="a1037"></a><br />1037          <span class="src-comm">// Context blocks</span><a name="a1038"></a><br />1038          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">enable_important_blocks</span> = <span class="src-id">false</span>;<a name="a1039"></a><br />1039      <span class="src-sym">}</span><a name="a1040"></a><br />1040  <a name="a1041"></a><br />1041      <span class="src-doc">/**</span><a name="a1042"></a><br />1042  <span class="src-doc">	 * Enables all highlighting</span><a name="a1043"></a><br />1043  <span class="src-doc">     * </span><a name="a1044"></a><br />1044  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a1045"></a><br />1045  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@todo</span><span class="src-doc">  Rewrite with array traversal</span><a name="a1046"></a><br />1046  <span class="src-doc">	 */</span><a name="a1047"></a><br />1047      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodenable_highlighting">enable_highlighting</a> <span class="src-sym">(</span><span class="src-sym">)</span><a name="a1048"></a><br />1048      <span class="src-sym">{</span><a name="a1049"></a><br />1049          <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span> <span class="src-key">as</span> <span class="src-var">$key</span> =&gt; <span class="src-var">$value</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1050"></a><br />1050              <span class="src-key">if</span> <span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1051"></a><br />1051                  <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$value</span> <span class="src-key">as</span> <span class="src-var">$k</span> =&gt; <span class="src-var">$v</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1052"></a><br />1052                      <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span> = <span class="src-id">true</span>;<a name="a1053"></a><br />1053                  <span class="src-sym">}</span><a name="a1054"></a><br />1054              <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1055"></a><br />1055                  <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-id">true</span>;<a name="a1056"></a><br />1056              <span class="src-sym">}</span><a name="a1057"></a><br />1057          <span class="src-sym">}</span><a name="a1058"></a><br />1058          <span class="src-comm">// Context blocks</span><a name="a1059"></a><br />1059          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">enable_important_blocks</span> = <span class="src-id">true</span>;<a name="a1060"></a><br />1060      <span class="src-sym">}</span><a name="a1061"></a><br />1061  <a name="a1062"></a><br />1062      <span class="src-doc">/**</span><a name="a1063"></a><br />1063  <span class="src-doc">	 * Given a file extension, this method returns either a valid geshi language</span><a name="a1064"></a><br />1064  <span class="src-doc">	 * name, or the empty string if it couldn't be found</span><a name="a1065"></a><br />1065  <span class="src-doc">     * </span><a name="a1066"></a><br />1066  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The extension to get a language name for</span><a name="a1067"></a><br />1067  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">array </span><span class="src-doc"> </span><span class="src-doc">A lookup array to use instead of the default</span><a name="a1068"></a><br />1068  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.5</span><a name="a1069"></a><br />1069  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@todo</span><span class="src-doc"> Re-think about how this method works (maybe make it private and/or make it</span><a name="a1070"></a><br />1070  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">       a extension-&gt;lang lookup?)</span><a name="a1071"></a><br />1071  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@todo</span><span class="src-doc"> static?</span><a name="a1072"></a><br />1072  <span class="src-doc">	 */</span><a name="a1073"></a><br />1073      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodget_language_name_from_extension">get_language_name_from_extension</a> <span class="src-sym">(</span> <span class="src-var">$extension</span><span class="src-sym">,</span> <span class="src-var">$lookup</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span> <span class="src-sym">)</span><a name="a1074"></a><br />1074      <span class="src-sym">{</span><a name="a1075"></a><br />1075          <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-sym">!</span><span class="src-var">$lookup</span> <span class="src-sym">)</span><a name="a1076"></a><br />1076          <span class="src-sym">{</span><a name="a1077"></a><br />1077              <span class="src-var">$lookup</span> = <span class="src-key">array</span><span class="src-sym">(</span><a name="a1078"></a><br />1078                  <span class="src-str">'actionscript'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'as'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1079"></a><br />1079                  <span class="src-str">'ada'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'a'</span><span class="src-sym">,</span> <span class="src-str">'ada'</span><span class="src-sym">,</span> <span class="src-str">'adb'</span><span class="src-sym">,</span> <span class="src-str">'ads'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1080"></a><br />1080                  <span class="src-str">'apache'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'conf'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1081"></a><br />1081                  <span class="src-str">'asm'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'ash'</span><span class="src-sym">,</span> <span class="src-str">'asm'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1082"></a><br />1082                  <span class="src-str">'asp'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'asp'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1083"></a><br />1083                  <span class="src-str">'bash'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'sh'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1084"></a><br />1084                  <span class="src-str">'c'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'c'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1085"></a><br />1085                  <span class="src-str">'c_mac'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'c'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1086"></a><br />1086                  <span class="src-str">'caddcl'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1087"></a><br />1087                  <span class="src-str">'cadlisp'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1088"></a><br />1088                  <span class="src-str">'cpp'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'cpp'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1089"></a><br />1089                  <span class="src-str">'csharp'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1090"></a><br />1090                  <span class="src-str">'css'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'css'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1091"></a><br />1091                  <span class="src-str">'delphi'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'dpk'</span><span class="src-sym">,</span> <span class="src-str">'dpr'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1092"></a><br />1092                  <span class="src-str">'html4strict'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'html'</span><span class="src-sym">,</span> <span class="src-str">'htm'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1093"></a><br />1093                  <span class="src-str">'java'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'java'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1094"></a><br />1094                  <span class="src-str">'javascript'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'js'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1095"></a><br />1095                  <span class="src-str">'lisp'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'lisp'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1096"></a><br />1096                  <span class="src-str">'lua'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'lua'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1097"></a><br />1097                  <span class="src-str">'mpasm'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1098"></a><br />1098                  <span class="src-str">'nsis'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1099"></a><br />1099                  <span class="src-str">'objc'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1100"></a><br />1100                  <span class="src-str">'oobas'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1101"></a><br />1101                  <span class="src-str">'oracle8'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1102"></a><br />1102                  <span class="src-str">'pascal'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'pas'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1103"></a><br />1103                  <span class="src-str">'perl'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'pl'</span><span class="src-sym">,</span> <span class="src-str">'pm'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1104"></a><br />1104                  <span class="src-str">'php'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'php'</span><span class="src-sym">,</span> <span class="src-str">'php5'</span><span class="src-sym">,</span> <span class="src-str">'phtml'</span><span class="src-sym">,</span> <span class="src-str">'phps'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1105"></a><br />1105                  <span class="src-str">'python'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'py'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1106"></a><br />1106                  <span class="src-str">'qbasic'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'bi'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1107"></a><br />1107                  <span class="src-str">'smarty'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1108"></a><br />1108                  <span class="src-str">'vb'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'bas'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1109"></a><br />1109                  <span class="src-str">'vbnet'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1110"></a><br />1110                  <span class="src-str">'visualfoxpro'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1111"></a><br />1111                  <span class="src-str">'xml'</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'xml'</span><span class="src-sym">)</span><a name="a1112"></a><br />1112              <span class="src-sym">)</span>;<a name="a1113"></a><br />1113          <span class="src-sym">}</span><a name="a1114"></a><br />1114  <a name="a1115"></a><br />1115          <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$lookup</span> <span class="src-key">as</span> <span class="src-var">$lang</span> =&gt; <span class="src-var">$extensions</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1116"></a><br />1116              <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$extensions</span> <span class="src-key">as</span> <span class="src-var">$ext</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1117"></a><br />1117                  <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$ext</span> == <span class="src-var">$extension</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1118"></a><br />1118                      <span class="src-key">return</span> <span class="src-var">$lang</span>;<a name="a1119"></a><br />1119                  <span class="src-sym">}</span><a name="a1120"></a><br />1120              <span class="src-sym">}</span><a name="a1121"></a><br />1121          <span class="src-sym">}</span><a name="a1122"></a><br />1122          <span class="src-key">return</span> <span class="src-str">''</span>;<a name="a1123"></a><br />1123      <span class="src-sym">}</span><a name="a1124"></a><br />1124  <a name="a1125"></a><br />1125      <span class="src-doc">/**</span><a name="a1126"></a><br />1126  <span class="src-doc">	 * Given a file name, this method loads its contents in, and attempts</span><a name="a1127"></a><br />1127  <span class="src-doc">	 * to set the language automatically. An optional lookup table can be</span><a name="a1128"></a><br />1128  <span class="src-doc">	 * passed for looking up the language name. If not specified a default</span><a name="a1129"></a><br />1129  <span class="src-doc">     * table is used</span><a name="a1130"></a><br />1130  <span class="src-doc">	 *</span><a name="a1131"></a><br />1131  <span class="src-doc">	 * The language table is in the form</span><a name="a1132"></a><br />1132  <span class="src-doc">	 * &lt;pre&gt;array(</span><a name="a1133"></a><br />1133  <span class="src-doc">	 *   'lang_name' =&gt; array('extension', 'extension', ...),</span><a name="a1134"></a><br />1134  <span class="src-doc">	 *   'lang_name' ...</span><a name="a1135"></a><br />1135  <span class="src-doc">	 * );&lt;/pre&gt;</span><a name="a1136"></a><br />1136  <span class="src-doc">     * </span><a name="a1137"></a><br />1137  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@todo</span><span class="src-doc"> Complete rethink of this and above method</span><a name="a1138"></a><br />1138  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.5</span><a name="a1139"></a><br />1139  <span class="src-doc">	 */</span><a name="a1140"></a><br />1140      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodload_from_file">load_from_file</a> <span class="src-sym">(</span><span class="src-var">$file_name</span><span class="src-sym">,</span> <span class="src-var">$lookup</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">)</span><a name="a1141"></a><br />1141      <span class="src-sym">{</span><a name="a1142"></a><br />1142          <span class="src-key">if</span> <span class="src-sym">(</span><a href="http://www.php.net/is_readable">is_readable</a><span class="src-sym">(</span><span class="src-var">$file_name</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1143"></a><br />1143              <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../core/GeSHi.html#methodset_source">set_source</a><span class="src-sym">(</span><a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">''</span><span class="src-sym">,</span> <a href="http://www.php.net/file">file</a><span class="src-sym">(</span><span class="src-var">$file_name</span><span class="src-sym">)</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a1144"></a><br />1144              <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../core/GeSHi.html#methodset_language">set_language</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../core/GeSHi.html#methodget_language_name_from_extension">get_language_name_from_extension</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/strrchr">strrchr</a><span class="src-sym">(</span><span class="src-var">$file_name</span><span class="src-sym">,</span> <span class="src-str">'.'</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-var">$lookup</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a1145"></a><br />1145          <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1146"></a><br />1146              <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span> = <span class="src-id">GESHI_ERROR_FILE_NOT_READABLE</span>;<a name="a1147"></a><br />1147          <span class="src-sym">}</span><a name="a1148"></a><br />1148      <span class="src-sym">}</span><a name="a1149"></a><br />1149  <a name="a1150"></a><br />1150      <span class="src-doc">/**</span><a name="a1151"></a><br />1151  <span class="src-doc">	 * Adds a keyword to a keyword group for highlighting</span><a name="a1152"></a><br />1152  <span class="src-doc">     * </span><a name="a1153"></a><br />1153  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc">   </span><span class="src-doc">The key of the keyword group to add the keyword to</span><a name="a1154"></a><br />1154  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The word to add to the keyword group</span><a name="a1155"></a><br />1155  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a1156"></a><br />1156  <span class="src-doc">	 */</span><a name="a1157"></a><br />1157      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodadd_keyword">add_keyword</a> <span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span> <span class="src-var">$word</span><span class="src-sym">)</span><a name="a1158"></a><br />1158      <span class="src-sym">{</span><a name="a1159"></a><br />1159          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">]</span> = <span class="src-var">$word</span>;<a name="a1160"></a><br />1160      <span class="src-sym">}</span><a name="a1161"></a><br />1161  <a name="a1162"></a><br />1162      <span class="src-doc">/**</span><a name="a1163"></a><br />1163  <span class="src-doc">	 * Removes a keyword from a keyword group</span><a name="a1164"></a><br />1164  <span class="src-doc">     * </span><a name="a1165"></a><br />1165  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc">   </span><span class="src-doc">The key of the keyword group to remove the keyword from</span><a name="a1166"></a><br />1166  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The word to remove from the keyword group</span><a name="a1167"></a><br />1167  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a1168"></a><br />1168  <span class="src-doc">	 */</span><a name="a1169"></a><br />1169      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodremove_keyword">remove_keyword</a> <span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span> <span class="src-var">$word</span><span class="src-sym">)</span><a name="a1170"></a><br />1170      <span class="src-sym">{</span><a name="a1171"></a><br />1171          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> =<a name="a1172"></a><br />1172              <a href="http://www.php.net/array_diff">array_diff</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">,</span> <span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$word</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a1173"></a><br />1173      <span class="src-sym">}</span><a name="a1174"></a><br />1174  <a name="a1175"></a><br />1175      <span class="src-doc">/**</span><a name="a1176"></a><br />1176  <span class="src-doc">	 * Creates a new keyword group</span><a name="a1177"></a><br />1177  <span class="src-doc">     * </span><a name="a1178"></a><br />1178  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc">   </span><span class="src-doc">The key of the keyword group to create</span><a name="a1179"></a><br />1179  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The styles for the keyword group</span><a name="a1180"></a><br />1180  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether the keyword group is case sensitive ornot</span><a name="a1181"></a><br />1181  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">array </span><span class="src-doc"> </span><span class="src-doc">The words to use for the keyword group</span><a name="a1182"></a><br />1182  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a1183"></a><br />1183  <span class="src-doc">	 */</span><a name="a1184"></a><br />1184      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodadd_keyword_group">add_keyword_group</a> <span class="src-sym">(</span> <span class="src-var">$key</span><span class="src-sym">,</span> <span class="src-var">$styles</span><span class="src-sym">,</span> <span class="src-var">$case_sensitive</span> = <span class="src-id">true</span><span class="src-sym">,</span> <span class="src-var">$words</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span> <span class="src-sym">)</span><a name="a1185"></a><br />1185      <span class="src-sym">{</span><a name="a1186"></a><br />1186          <span class="src-var">$words</span> = (array) <span class="src-var">$words</span>;<a name="a1187"></a><br />1187          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-var">$words</span>;<a name="a1188"></a><br />1188          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-id">true</span>;<a name="a1189"></a><br />1189          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CASE_SENSITIVE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-var">$case_sensitive</span>;<a name="a1190"></a><br />1190          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-var">$styles</span>;<a name="a1191"></a><br />1191      <span class="src-sym">}</span><a name="a1192"></a><br />1192  <a name="a1193"></a><br />1193      <span class="src-doc">/**</span><a name="a1194"></a><br />1194  <span class="src-doc">	 * Removes a keyword group</span><a name="a1195"></a><br />1195  <span class="src-doc">     * </span><a name="a1196"></a><br />1196  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc">   </span><span class="src-doc">The key of the keyword group to remove</span><a name="a1197"></a><br />1197  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a1198"></a><br />1198  <span class="src-doc">	 */</span><a name="a1199"></a><br />1199      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodremove_keyword_group">remove_keyword_group</a> <span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">)</span><a name="a1200"></a><br />1200      <span class="src-sym">{</span><a name="a1201"></a><br />1201          unset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span>;<a name="a1202"></a><br />1202          unset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span>;<a name="a1203"></a><br />1203          unset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CASE_SENSITIVE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span>;<a name="a1204"></a><br />1204          unset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span>;<a name="a1205"></a><br />1205      <span class="src-sym">}</span><a name="a1206"></a><br />1206  <a name="a1207"></a><br />1207      <span class="src-doc">/**</span><a name="a1208"></a><br />1208  <span class="src-doc">	 * Sets the content of the header block</span><a name="a1209"></a><br />1209  <span class="src-doc">     * </span><a name="a1210"></a><br />1210  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The content of the header block</span><a name="a1211"></a><br />1211  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.2</span><a name="a1212"></a><br />1212  <span class="src-doc">	 */</span><a name="a1213"></a><br />1213      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_header_content">set_header_content</a> <span class="src-sym">(</span><span class="src-var">$content</span><span class="src-sym">)</span><a name="a1214"></a><br />1214      <span class="src-sym">{</span><a name="a1215"></a><br />1215          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">header_content</span> = <span class="src-var">$content</span>;<a name="a1216"></a><br />1216      <span class="src-sym">}</span><a name="a1217"></a><br />1217  <a name="a1218"></a><br />1218      <span class="src-doc">/**</span><a name="a1219"></a><br />1219  <span class="src-doc">	 * Sets the content of the footer block</span><a name="a1220"></a><br />1220  <span class="src-doc">     * </span><a name="a1221"></a><br />1221  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The content of the footer block</span><a name="a1222"></a><br />1222  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.2</span><a name="a1223"></a><br />1223  <span class="src-doc">	 */</span><a name="a1224"></a><br />1224      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_footer_content">set_footer_content</a> <span class="src-sym">(</span><span class="src-var">$content</span><span class="src-sym">)</span><a name="a1225"></a><br />1225      <span class="src-sym">{</span><a name="a1226"></a><br />1226          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">footer_content</span> = <span class="src-var">$content</span>;<a name="a1227"></a><br />1227      <span class="src-sym">}</span><a name="a1228"></a><br />1228  <a name="a1229"></a><br />1229      <span class="src-doc">/**</span><a name="a1230"></a><br />1230  <span class="src-doc">	 * Sets the style for the header content</span><a name="a1231"></a><br />1231  <span class="src-doc">     * </span><a name="a1232"></a><br />1232  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The style for the header content</span><a name="a1233"></a><br />1233  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.2</span><a name="a1234"></a><br />1234  <span class="src-doc">	 */</span><a name="a1235"></a><br />1235      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_header_content_style">set_header_content_style</a> <span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">)</span><a name="a1236"></a><br />1236      <span class="src-sym">{</span><a name="a1237"></a><br />1237          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">header_content_style</span> = <span class="src-var">$style</span>;<a name="a1238"></a><br />1238      <span class="src-sym">}</span><a name="a1239"></a><br />1239  <a name="a1240"></a><br />1240      <span class="src-doc">/**</span><a name="a1241"></a><br />1241  <span class="src-doc">	 * Sets the style for the footer content</span><a name="a1242"></a><br />1242  <span class="src-doc">     * </span><a name="a1243"></a><br />1243  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The style for the footer content</span><a name="a1244"></a><br />1244  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.2</span><a name="a1245"></a><br />1245  <span class="src-doc">	 */</span><a name="a1246"></a><br />1246      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_footer_content_style">set_footer_content_style</a> <span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">)</span><a name="a1247"></a><br />1247      <span class="src-sym">{</span><a name="a1248"></a><br />1248          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">footer_content_style</span> = <span class="src-var">$style</span>;<a name="a1249"></a><br />1249      <span class="src-sym">}</span><a name="a1250"></a><br />1250  <a name="a1251"></a><br />1251      <span class="src-doc">/**</span><a name="a1252"></a><br />1252  <span class="src-doc">	 * Sets the base URL to be used for keywords</span><a name="a1253"></a><br />1253  <span class="src-doc">     * </span><a name="a1254"></a><br />1254  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc"></span><span class="src-doc">The key of the keyword group to set the URL for</span><a name="a1255"></a><br />1255  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The URL to set for the group. If {FNAME} is in</span><a name="a1256"></a><br />1256  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">               the url somewhere, it is replaced by the keyword</span><a name="a1257"></a><br />1257  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">               that the URL is being made for</span><a name="a1258"></a><br />1258  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.2</span><a name="a1259"></a><br />1259  <span class="src-doc">	 */</span><a name="a1260"></a><br />1260      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_url_for_keyword_group">set_url_for_keyword_group</a> <span class="src-sym">(</span><span class="src-var">$group</span><span class="src-sym">,</span> <span class="src-var">$url</span><span class="src-sym">)</span><a name="a1261"></a><br />1261      <span class="src-sym">{</span><a name="a1262"></a><br />1262          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'URLS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span> = <span class="src-var">$url</span>;<a name="a1263"></a><br />1263      <span class="src-sym">}</span><a name="a1264"></a><br />1264  <a name="a1265"></a><br />1265      <span class="src-doc">/**</span><a name="a1266"></a><br />1266  <span class="src-doc">	 * Sets styles for links in code</span><a name="a1267"></a><br />1267  <span class="src-doc">     * </span><a name="a1268"></a><br />1268  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc"></span><span class="src-doc">A constant that specifies what state the style is being</span><a name="a1269"></a><br />1269  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">            set for - e.g. :hover or :visited</span><a name="a1270"></a><br />1270  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The styles to use for that state</span><a name="a1271"></a><br />1271  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.2</span><a name="a1272"></a><br />1272  <span class="src-doc">	 */</span><a name="a1273"></a><br />1273      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_link_styles">set_link_styles</a> <span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">,</span> <span class="src-var">$styles</span><span class="src-sym">)</span><a name="a1274"></a><br />1274      <span class="src-sym">{</span><a name="a1275"></a><br />1275          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">link_styles</span><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span> = <span class="src-var">$styles</span>;<a name="a1276"></a><br />1276      <span class="src-sym">}</span><a name="a1277"></a><br />1277  <a name="a1278"></a><br />1278      <span class="src-doc">/**</span><a name="a1279"></a><br />1279  <span class="src-doc">     * Sets the target for links in code</span><a name="a1280"></a><br />1280  <span class="src-doc">     * </span><a name="a1281"></a><br />1281  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The target for links in the code, e.g. _blank</span><a name="a1282"></a><br />1282  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.3</span><a name="a1283"></a><br />1283  <span class="src-doc">     */</span><a name="a1284"></a><br />1284      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_link_target">set_link_target</a> <span class="src-sym">(</span> <span class="src-var">$target</span> <span class="src-sym">)</span><a name="a1285"></a><br />1285      <span class="src-sym">{</span><a name="a1286"></a><br />1286          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$target</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1287"></a><br />1287              <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">link_target</span> = <span class="src-str">''</span>;<a name="a1288"></a><br />1288          <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1289"></a><br />1289              <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">link_target</span> = <span class="src-str">' target=&quot;'</span> . <span class="src-var">$target</span> . <span class="src-str">'&quot; '</span>;<a name="a1290"></a><br />1290          <span class="src-sym">}</span><a name="a1291"></a><br />1291      <span class="src-sym">}</span><a name="a1292"></a><br />1292  <a name="a1293"></a><br />1293      <span class="src-doc">/**</span><a name="a1294"></a><br />1294  <span class="src-doc">	 * Sets styles for important parts of the code</span><a name="a1295"></a><br />1295  <span class="src-doc">     * </span><a name="a1296"></a><br />1296  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The styles to use on important parts of the code</span><a name="a1297"></a><br />1297  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.2</span><a name="a1298"></a><br />1298  <span class="src-doc">	 */</span><a name="a1299"></a><br />1299      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_important_styles">set_important_styles</a> <span class="src-sym">(</span><span class="src-var">$styles</span><span class="src-sym">)</span><a name="a1300"></a><br />1300      <span class="src-sym">{</span><a name="a1301"></a><br />1301          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">important_styles</span> = <span class="src-var">$styles</span>;<a name="a1302"></a><br />1302      <span class="src-sym">}</span><a name="a1303"></a><br />1303  <a name="a1304"></a><br />1304      <span class="src-doc">/**</span><a name="a1305"></a><br />1305  <span class="src-doc">	 * Sets whether context-important blocks are highlighted</span><a name="a1306"></a><br />1306  <span class="src-doc">     * </span><a name="a1307"></a><br />1307  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@todo</span><span class="src-doc"> REMOVE THIS SHIZ FROM GESHI!</span><a name="a1308"></a><br />1308  <span class="src-doc">	 */</span><a name="a1309"></a><br />1309      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodenable_important_blocks">enable_important_blocks</a> <span class="src-sym">(</span> <span class="src-var">$flag</span> <span class="src-sym">)</span><a name="a1310"></a><br />1310      <span class="src-sym">{</span><a name="a1311"></a><br />1311          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">enable_important_blocks</span> = <span class="src-sym">(</span> <span class="src-var">$flag</span> <span class="src-sym">)</span> ? <span class="src-id">true</span> : <span class="src-id">false</span>;<a name="a1312"></a><br />1312      <span class="src-sym">}</span><a name="a1313"></a><br />1313  <a name="a1314"></a><br />1314      <span class="src-doc">/**</span><a name="a1315"></a><br />1315  <span class="src-doc">	 * Whether CSS IDs should be added to each line</span><a name="a1316"></a><br />1316  <span class="src-doc">     * </span><a name="a1317"></a><br />1317  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">If true, IDs will be added to each line.</span><a name="a1318"></a><br />1318  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.2</span><a name="a1319"></a><br />1319  <span class="src-doc">	 */</span><a name="a1320"></a><br />1320      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodenable_ids">enable_ids</a> <span class="src-sym">(</span><span class="src-var">$flag</span> = <span class="src-id">true</span><span class="src-sym">)</span><a name="a1321"></a><br />1321      <span class="src-sym">{</span><a name="a1322"></a><br />1322          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">add_ids</span> = <span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span> ? <span class="src-id">true</span> : <span class="src-id">false</span>;<a name="a1323"></a><br />1323      <span class="src-sym">}</span><a name="a1324"></a><br />1324  <a name="a1325"></a><br />1325      <span class="src-doc">/**</span><a name="a1326"></a><br />1326  <span class="src-doc">	 * Specifies which lines to highlight extra</span><a name="a1327"></a><br />1327  <span class="src-doc">     * </span><a name="a1328"></a><br />1328  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">mixed </span><span class="src-doc"></span><span class="src-doc">An array of line numbers to highlight, or just a line</span><a name="a1329"></a><br />1329  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc">              number on its own.</span><a name="a1330"></a><br />1330  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.2</span><a name="a1331"></a><br />1331  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@todo</span><span class="src-doc">  Some data replication here that could be cut down on</span><a name="a1332"></a><br />1332  <span class="src-doc">	 */</span><a name="a1333"></a><br />1333      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodhighlight_lines_extra">highlight_lines_extra</a> <span class="src-sym">(</span><span class="src-var">$lines</span><span class="src-sym">)</span><a name="a1334"></a><br />1334      <span class="src-sym">{</span><a name="a1335"></a><br />1335          <span class="src-key">if</span> <span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$lines</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1336"></a><br />1336              <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$lines</span> <span class="src-key">as</span> <span class="src-var">$line</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1337"></a><br />1337                  <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines</span><span class="src-sym">[</span><a href="http://www.php.net/intval">intval</a><span class="src-sym">(</span><span class="src-var">$line</span><span class="src-sym">)</span><span class="src-sym">]</span> = <a href="http://www.php.net/intval">intval</a><span class="src-sym">(</span><span class="src-var">$line</span><span class="src-sym">)</span>;<a name="a1338"></a><br />1338              <span class="src-sym">}</span><a name="a1339"></a><br />1339          <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1340"></a><br />1340              <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines</span><span class="src-sym">[</span><a href="http://www.php.net/intval">intval</a><span class="src-sym">(</span><span class="src-var">$lines</span><span class="src-sym">)</span><span class="src-sym">]</span> = <a href="http://www.php.net/intval">intval</a><span class="src-sym">(</span><span class="src-var">$lines</span><span class="src-sym">)</span>;<a name="a1341"></a><br />1341          <span class="src-sym">}</span><a name="a1342"></a><br />1342      <span class="src-sym">}</span><a name="a1343"></a><br />1343  <a name="a1344"></a><br />1344      <span class="src-doc">/**</span><a name="a1345"></a><br />1345  <span class="src-doc">	 * Sets the style for extra-highlighted lines</span><a name="a1346"></a><br />1346  <span class="src-doc">     * </span><a name="a1347"></a><br />1347  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The style for extra-highlighted lines</span><a name="a1348"></a><br />1348  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.2</span><a name="a1349"></a><br />1349  <span class="src-doc">	 */</span><a name="a1350"></a><br />1350      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_highlight_lines_extra_style">set_highlight_lines_extra_style</a> <span class="src-sym">(</span><span class="src-var">$styles</span><span class="src-sym">)</span><a name="a1351"></a><br />1351      <span class="src-sym">{</span><a name="a1352"></a><br />1352          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines_style</span> = <span class="src-var">$styles</span>;<a name="a1353"></a><br />1353      <span class="src-sym">}</span><a name="a1354"></a><br />1354  <a name="a1355"></a><br />1355      <span class="src-doc">/**</span><a name="a1356"></a><br />1356  <span class="src-doc">	 * Sets what number line numbers should start at. Should</span><a name="a1357"></a><br />1357  <span class="src-doc">	 * be a positive integer, and will be converted to one.</span><a name="a1358"></a><br />1358  <span class="src-doc">     * </span><a name="a1359"></a><br />1359  <span class="src-doc">     * &lt;b&gt;Warning:&lt;/b&gt; Using this method will add the &quot;start&quot;</span><a name="a1360"></a><br />1360  <span class="src-doc">     * attribute to the &amp;lt;ol&amp;gt; that is used for line numbering.</span><a name="a1361"></a><br />1361  <span class="src-doc">     * This is &lt;b&gt;not&lt;/b&gt; valid XHTML strict, so if that's what you</span><a name="a1362"></a><br />1362  <span class="src-doc">     * care about then don't use this method. Firefox is getting</span><a name="a1363"></a><br />1363  <span class="src-doc">     * support for the CSS method of doing this in 1.1 and Opera</span><a name="a1364"></a><br />1364  <span class="src-doc">     * has support for the CSS method, but (of course) IE doesn't</span><a name="a1365"></a><br />1365  <span class="src-doc">     * so it's not worth doing it the CSS way yet.</span><a name="a1366"></a><br />1366  <span class="src-doc">     * </span><a name="a1367"></a><br />1367  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">int </span><span class="src-doc"></span><span class="src-doc">The number to start line numbers at</span><a name="a1368"></a><br />1368  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.2</span><a name="a1369"></a><br />1369  <span class="src-doc">	 */</span><a name="a1370"></a><br />1370      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodstart_line_numbers_at">start_line_numbers_at</a> <span class="src-sym">(</span><span class="src-var">$number</span><span class="src-sym">)</span><a name="a1371"></a><br />1371      <span class="src-sym">{</span><a name="a1372"></a><br />1372          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_numbers_start</span> = <a href="http://www.php.net/abs">abs</a><span class="src-sym">(</span><a href="http://www.php.net/intval">intval</a><span class="src-sym">(</span><span class="src-var">$number</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a1373"></a><br />1373      <span class="src-sym">}</span><a name="a1374"></a><br />1374  <a name="a1375"></a><br />1375      <span class="src-doc">/**</span><a name="a1376"></a><br />1376  <span class="src-doc">	 * Sets the encoding used for htmlspecialchars(), for international</span><a name="a1377"></a><br />1377  <span class="src-doc">	 * support.</span><a name="a1378"></a><br />1378  <span class="src-doc">     * </span><a name="a1379"></a><br />1379  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The encoding to use for the source</span><a name="a1380"></a><br />1380  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.3</span><a name="a1381"></a><br />1381  <span class="src-doc">	 */</span><a name="a1382"></a><br />1382      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodset_encoding">set_encoding</a> <span class="src-sym">(</span><span class="src-var">$encoding</span><span class="src-sym">)</span><a name="a1383"></a><br />1383      <span class="src-sym">{</span><a name="a1384"></a><br />1384          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$encoding</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1385"></a><br />1385            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span> = <span class="src-var">$encoding</span>;<a name="a1386"></a><br />1386          <span class="src-sym">}</span><a name="a1387"></a><br />1387      <span class="src-sym">}</span><a name="a1388"></a><br />1388  <a name="a1389"></a><br />1389      <span class="src-doc">/**</span><a name="a1390"></a><br />1390  <span class="src-doc">	 * Returns the code in $this-&gt;source, highlighted and surrounded by the</span><a name="a1391"></a><br />1391  <span class="src-doc">	 * nessecary HTML.</span><a name="a1392"></a><br />1392  <span class="src-doc">     * </span><a name="a1393"></a><br />1393  <span class="src-doc">     * This should only be called ONCE, cos it's SLOW! If you want to highlight</span><a name="a1394"></a><br />1394  <span class="src-doc">     * the same source multiple times, you're better off doing a whole lot of</span><a name="a1395"></a><br />1395  <span class="src-doc">     * str_replaces to replace the &amp;lt;span&amp;gt;s</span><a name="a1396"></a><br />1396  <span class="src-doc">     * </span><a name="a1397"></a><br />1397  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a1398"></a><br />1398  <span class="src-doc">	 */</span><a name="a1399"></a><br />1399      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodparse_code">parse_code</a> <span class="src-sym">(</span><span class="src-sym">)</span><a name="a1400"></a><br />1400      <span class="src-sym">{</span><a name="a1401"></a><br />1401          <span class="src-comm">// Start the timer</span><a name="a1402"></a><br />1402          <span class="src-var">$start_time</span> = <a href="http://www.php.net/microtime">microtime</a><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a1403"></a><br />1403  <a name="a1404"></a><br />1404          <span class="src-comm">// Firstly, if there is an error, we won't highlight</span><a name="a1405"></a><br />1405          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1406"></a><br />1406              <span class="src-var">$result</span> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header</span><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a1407"></a><br />1407              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">header_type</span> != <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_HEADER_PRE">GESHI_HEADER_PRE</a></span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1408"></a><br />1408                  <span class="src-var">$result</span> .= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">indent</span><span class="src-sym">(</span><span class="src-sym">@</span><a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">source</span><span class="src-sym">,</span> <span class="src-id">ENT_COMPAT</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a1409"></a><br />1409              <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1410"></a><br />1410                  <span class="src-var">$result</span> .= <span class="src-sym">@</span><a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">source</span><span class="src-sym">,</span> <span class="src-id">ENT_COMPAT</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span><span class="src-sym">)</span>;<a name="a1411"></a><br />1411              <span class="src-sym">}</span><a name="a1412"></a><br />1412              <span class="src-comm">// Stop Timing</span><a name="a1413"></a><br />1413              <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">set_time</span><span class="src-sym">(</span><span class="src-var">$start_time</span><span class="src-sym">,</span> <a href="http://www.php.net/microtime">microtime</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a1414"></a><br />1414              <span class="src-key">return</span> <span class="src-var">$result</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">footer</span><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a1415"></a><br />1415          <span class="src-sym">}</span><a name="a1416"></a><br />1416  <a name="a1417"></a><br />1417          <span class="src-comm">// Add spaces for regular expression matching and line numbers</span><a name="a1418"></a><br />1418          <span class="src-var">$code</span> = <span class="src-str">' '</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">source</span> . <span class="src-str">' '</span>;<a name="a1419"></a><br />1419          <span class="src-comm">// Replace all newlines to a common form.</span><a name="a1420"></a><br />1420          <span class="src-var">$code</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\r\n&quot;</span><span class="src-sym">,</span> <span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span> <span class="src-var">$code</span><span class="src-sym">)</span>;<a name="a1421"></a><br />1421          <span class="src-var">$code</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\r&quot;</span><span class="src-sym">,</span> <span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span> <span class="src-var">$code</span><span class="src-sym">)</span>;<a name="a1422"></a><br />1422  <a name="a1423"></a><br />1423          <span class="src-comm">// Initialise various stuff</span><a name="a1424"></a><br />1424          <span class="src-var">$length</span>           = <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">)</span>;<a name="a1425"></a><br />1425          <span class="src-var">$STRING_OPEN</span>      = <span class="src-str">''</span>;<a name="a1426"></a><br />1426          <span class="src-var">$CLOSE_STRING</span>     = <span class="src-id">false</span>;<a name="a1427"></a><br />1427          <span class="src-var">$ESCAPE_CHAR_OPEN</span> = <span class="src-id">false</span>;<a name="a1428"></a><br />1428          <span class="src-var">$COMMENT_MATCHED</span>  = <span class="src-id">false</span>;<a name="a1429"></a><br />1429          <span class="src-comm">// Turn highlighting on if strict mode doesn't apply to this language</span><a name="a1430"></a><br />1430          <span class="src-var">$HIGHLIGHTING_ON</span>  = <span class="src-sym">(</span> <span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">strict_mode</span> <span class="src-sym">)</span> ? <span class="src-id">true</span> : <span class="src-str">''</span>;<a name="a1431"></a><br />1431          <span class="src-comm">// Whether to highlight inside a block of code</span><a name="a1432"></a><br />1432          <span class="src-var">$HIGHLIGHT_INSIDE_STRICT</span> = <span class="src-id">false</span>;<a name="a1433"></a><br />1433          <span class="src-var">$stuff_to_parse</span>   = <span class="src-str">''</span>;<a name="a1434"></a><br />1434          <span class="src-var">$result</span>           = <span class="src-str">''</span>;<a name="a1435"></a><br />1435  <a name="a1436"></a><br />1436          <span class="src-comm">// &quot;Important&quot; selections are handled like multiline comments</span><a name="a1437"></a><br />1437          <span class="src-comm">// @todo GET RID OF THIS SHIZ</span><a name="a1438"></a><br />1438          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">enable_important_blocks</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1439"></a><br />1439              <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'COMMENT_MULTI'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_START_IMPORTANT">GESHI_START_IMPORTANT</a></span><span class="src-sym">]</span> = <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_END_IMPORTANT">GESHI_END_IMPORTANT</a></span>;<a name="a1440"></a><br />1440          <span class="src-sym">}</span><a name="a1441"></a><br />1441  <a name="a1442"></a><br />1442          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">strict_mode</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1443"></a><br />1443              <span class="src-comm">// Break the source into bits. Each bit will be a portion of the code</span><a name="a1444"></a><br />1444              <span class="src-comm">// within script delimiters - for example, HTML between &lt; and &gt;</span><a name="a1445"></a><br />1445              <span class="src-var">$parts</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-num">0</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-num">0</span> =&gt; <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a1446"></a><br />1446              <span class="src-var">$k</span> = <span class="src-num">0</span>;<a name="a1447"></a><br />1447              <span class="src-key">for</span> <span class="src-sym">(</span><span class="src-var">$i</span> = <span class="src-num">0</span>; <span class="src-var">$i</span> &lt; <span class="src-var">$length</span>; <span class="src-var">$i</span>++<span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1448"></a><br />1448                  <span class="src-var">$char</span> = <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">,</span> <span class="src-var">$i</span><span class="src-sym">,</span> <span class="src-num">1</span><span class="src-sym">)</span>;<a name="a1449"></a><br />1449                  <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$HIGHLIGHTING_ON</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1450"></a><br />1450                      <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'SCRIPT_DELIMITERS'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$key</span> =&gt; <span class="src-var">$delimiters</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1451"></a><br />1451                          <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$delimiters</span> <span class="src-key">as</span> <span class="src-var">$open</span> =&gt; <span class="src-var">$close</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1452"></a><br />1452                              <span class="src-comm">// Get the next little bit for this opening string</span><a name="a1453"></a><br />1453                              <span class="src-var">$check</span> = <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">,</span> <span class="src-var">$i</span><span class="src-sym">,</span> <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$open</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a1454"></a><br />1454                              <span class="src-comm">// If it matches...</span><a name="a1455"></a><br />1455                              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$check</span> == <span class="src-var">$open</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1456"></a><br />1456                                  <span class="src-comm">// We start a new block with the highlightable</span><a name="a1457"></a><br />1457                                  <span class="src-comm">// code in it</span><a name="a1458"></a><br />1458                                  <span class="src-var">$HIGHLIGHTING_ON</span> = <span class="src-var">$open</span>;<a name="a1459"></a><br />1459                                  <span class="src-var">$i</span> += <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$open</span><span class="src-sym">)</span> - <span class="src-num">1</span>;<a name="a1460"></a><br />1460                                  <span class="src-var">$char</span> = <span class="src-var">$open</span>;<a name="a1461"></a><br />1461                                  <span class="src-var">$parts</span><span class="src-sym">[</span>++<span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> = <span class="src-var">$char</span>;<a name="a1462"></a><br />1462  <a name="a1463"></a><br />1463                                  <span class="src-comm">// No point going around again...</span><a name="a1464"></a><br />1464                                  <span class="src-key">break</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">)</span>;<a name="a1465"></a><br />1465                              <span class="src-sym">}</span><a name="a1466"></a><br />1466                          <span class="src-sym">}</span><a name="a1467"></a><br />1467                      <span class="src-sym">}</span><a name="a1468"></a><br />1468                  <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1469"></a><br />1469                      <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'SCRIPT_DELIMITERS'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$key</span> =&gt; <span class="src-var">$delimiters</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1470"></a><br />1470                          <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$delimiters</span> <span class="src-key">as</span> <span class="src-var">$open</span> =&gt; <span class="src-var">$close</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1471"></a><br />1471                              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$open</span> == <span class="src-var">$HIGHLIGHTING_ON</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1472"></a><br />1472                                  <span class="src-comm">// Found the closing tag</span><a name="a1473"></a><br />1473                                  <span class="src-key">break</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">)</span>;<a name="a1474"></a><br />1474                              <span class="src-sym">}</span><a name="a1475"></a><br />1475                          <span class="src-sym">}</span><a name="a1476"></a><br />1476                      <span class="src-sym">}</span><a name="a1477"></a><br />1477                      <span class="src-comm">// We check code from our current position BACKWARDS. This is so</span><a name="a1478"></a><br />1478                      <span class="src-comm">// the ending string for highlighting can be included in the block</span><a name="a1479"></a><br />1479                      <span class="src-var">$check</span> = <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">,</span> <span class="src-var">$i</span> - <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$close</span><span class="src-sym">)</span> + <span class="src-num">1</span><span class="src-sym">,</span> <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$close</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a1480"></a><br />1480                      <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$check</span> == <span class="src-var">$close</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1481"></a><br />1481                          <span class="src-var">$HIGHLIGHTING_ON</span> = <span class="src-str">''</span>;<a name="a1482"></a><br />1482                          <span class="src-comm">// Add the string to the rest of the string for this part</span><a name="a1483"></a><br />1483                          <span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span> = <span class="src-sym">(</span> isset<span class="src-sym">(</span><span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">)</span> ? <span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span> . <span class="src-var">$char</span> : <span class="src-var">$char</span>;<a name="a1484"></a><br />1484                          <span class="src-var">$parts</span><span class="src-sym">[</span>++<span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> = <span class="src-str">''</span>;<a name="a1485"></a><br />1485                          <span class="src-var">$char</span> = <span class="src-str">''</span>;<a name="a1486"></a><br />1486                      <span class="src-sym">}</span><a name="a1487"></a><br />1487                  <span class="src-sym">}</span><a name="a1488"></a><br />1488                  <span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span> = <span class="src-sym">(</span> isset<span class="src-sym">(</span><span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">)</span> ? <span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span> . <span class="src-var">$char</span> : <span class="src-var">$char</span>;<a name="a1489"></a><br />1489              <span class="src-sym">}</span><a name="a1490"></a><br />1490              <span class="src-var">$HIGHLIGHTING_ON</span> = <span class="src-str">''</span>;<a name="a1491"></a><br />1491          <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1492"></a><br />1492              <span class="src-comm">// Not strict mode - simply dump the source into</span><a name="a1493"></a><br />1493              <span class="src-comm">// the array at index 1 (the first highlightable block)</span><a name="a1494"></a><br />1494              <span class="src-var">$parts</span> = <span class="src-key">array</span><span class="src-sym">(</span><a name="a1495"></a><br />1495                  <span class="src-num">1</span> =&gt; <span class="src-key">array</span><span class="src-sym">(</span><a name="a1496"></a><br />1496                      <span class="src-num">0</span> =&gt; <span class="src-str">''</span><span class="src-sym">,</span><a name="a1497"></a><br />1497                      <span class="src-num">1</span> =&gt; <span class="src-var">$code</span><a name="a1498"></a><br />1498                  <span class="src-sym">)</span><a name="a1499"></a><br />1499              <span class="src-sym">)</span>;<a name="a1500"></a><br />1500          <span class="src-sym">}</span><a name="a1501"></a><br />1501  <a name="a1502"></a><br />1502          <span class="src-comm">// Now we go through each part. We know that even-indexed parts are</span><a name="a1503"></a><br />1503          <span class="src-comm">// code that shouldn't be highlighted, and odd-indexed parts should</span><a name="a1504"></a><br />1504          <span class="src-comm">// be highlighted</span><a name="a1505"></a><br />1505          <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$parts</span> <span class="src-key">as</span> <span class="src-var">$key</span> =&gt; <span class="src-var">$data</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1506"></a><br />1506              <span class="src-var">$part</span> = <span class="src-var">$data</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span>;<a name="a1507"></a><br />1507              <span class="src-comm">// If this block should be highlighted...</span><a name="a1508"></a><br />1508              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$key</span> % <span class="src-num">2</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1509"></a><br />1509                  <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">strict_mode</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1510"></a><br />1510                      <span class="src-comm">// Find the class key for this block of code</span><a name="a1511"></a><br />1511                      <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'SCRIPT_DELIMITERS'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$script_key</span> =&gt; <span class="src-var">$script_data</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1512"></a><br />1512                          <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$script_data</span> <span class="src-key">as</span> <span class="src-var">$open</span> =&gt; <span class="src-var">$close</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1513"></a><br />1513                              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> == <span class="src-var">$open</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1514"></a><br />1514                                  <span class="src-key">break</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">)</span>;<a name="a1515"></a><br />1515                              <span class="src-sym">}</span><a name="a1516"></a><br />1516                          <span class="src-sym">}</span><a name="a1517"></a><br />1517                      <span class="src-sym">}</span><a name="a1518"></a><br />1518  <a name="a1519"></a><br />1519                      <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'SCRIPT'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$script_key</span><span class="src-sym">]</span> != <span class="src-str">''</span> &amp;&amp;<a name="a1520"></a><br />1520                          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'SCRIPT'</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1521"></a><br />1521                          <span class="src-comm">// Add a span element around the source to</span><a name="a1522"></a><br />1522                          <span class="src-comm">// highlight the overall source block</span><a name="a1523"></a><br />1523                          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span> &amp;&amp;<a name="a1524"></a><br />1524                              <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'SCRIPT'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$script_key</span><span class="src-sym">]</span> != <span class="src-str">''</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1525"></a><br />1525                              <span class="src-var">$attributes</span> = <span class="src-str">' style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'SCRIPT'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$script_key</span><span class="src-sym">]</span> . <span class="src-str">'&quot;'</span>;<a name="a1526"></a><br />1526                          <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1527"></a><br />1527                              <span class="src-var">$attributes</span> = <span class="src-str">' class=&quot;sc'</span> . <span class="src-var">$script_key</span> . <span class="src-str">'&quot;'</span>;<a name="a1528"></a><br />1528                          <span class="src-sym">}</span><a name="a1529"></a><br />1529                          <span class="src-var">$result</span> .= &quot;<span class="src-str">&lt;<span class="src-id">span</span><span class="src-var">$attributes</span>&gt;</span>&quot;;<a name="a1530"></a><br />1530                      <span class="src-sym">}</span><a name="a1531"></a><br />1531                  <span class="src-sym">}</span><a name="a1532"></a><br />1532  <a name="a1533"></a><br />1533                  <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">strict_mode</span> || <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'HIGHLIGHT_STRICT_BLOCK'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$script_key</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1534"></a><br />1534                      <span class="src-comm">// Now, highlight the code in this block. This code</span><a name="a1535"></a><br />1535                      <span class="src-comm">// is really the engine of GeSHi (along with the method</span><a name="a1536"></a><br />1536                      <span class="src-comm">// parse_non_string_part).</span><a name="a1537"></a><br />1537                      <span class="src-var">$length</span> = <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">)</span>;<a name="a1538"></a><br />1538                      <span class="src-key">for</span> <span class="src-sym">(</span><span class="src-var">$i</span> = <span class="src-num">0</span>; <span class="src-var">$i</span> &lt; <span class="src-var">$length</span>; <span class="src-var">$i</span>++<span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1539"></a><br />1539                          <span class="src-comm">// Get the next char</span><a name="a1540"></a><br />1540                          <span class="src-var">$char</span> = <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span> <span class="src-var">$i</span><span class="src-sym">,</span> <span class="src-num">1</span><span class="src-sym">)</span>;<a name="a1541"></a><br />1541                          <span class="src-comm">// Is this char the newline and line numbers being used?</span><a name="a1542"></a><br />1542                          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_numbers</span> != <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_NO_LINE_NUMBERS">GESHI_NO_LINE_NUMBERS</a></span><a name="a1543"></a><br />1543                              || <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines</span><span class="src-sym">)</span> &gt; <span class="src-num">0</span><span class="src-sym">)</span><a name="a1544"></a><br />1544                              &amp;&amp; <span class="src-var">$char</span> == <span class="src-str">&quot;\n&quot;</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1545"></a><br />1545                              <span class="src-comm">// If so, is there a string open? If there is, we should end it before</span><a name="a1546"></a><br />1546                              <span class="src-comm">// the newline and begin it again (so when &lt;li&gt;s are put in the source</span><a name="a1547"></a><br />1547                              <span class="src-comm">// remains XHTML compliant)</span><a name="a1548"></a><br />1548                              <span class="src-comm">// note to self: This opens up possibility of config files specifying</span><a name="a1549"></a><br />1549                              <span class="src-comm">// that languages can/cannot have multiline strings???</span><a name="a1550"></a><br />1550                              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$STRING_OPEN</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1551"></a><br />1551                                  <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1552"></a><br />1552                                      <span class="src-var">$attributes</span> = <span class="src-str">' style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> . <span class="src-str">'&quot;'</span>;<a name="a1553"></a><br />1553                                  <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1554"></a><br />1554                                      <span class="src-var">$attributes</span> = <span class="src-str">' class=&quot;st0&quot;'</span>;<a name="a1555"></a><br />1555                                  <span class="src-sym">}</span><a name="a1556"></a><br />1556                                  <span class="src-var">$char</span> = <span class="src-str">'&lt;/span&gt;'</span> . <span class="src-var">$char</span> . &quot;<span class="src-str">&lt;<span class="src-id">span</span><span class="src-var">$attributes</span>&gt;</span>&quot;;<a name="a1557"></a><br />1557                              <span class="src-sym">}</span><a name="a1558"></a><br />1558                          <span class="src-sym">}</span> <span class="src-key">elseif</span> <span class="src-sym">(</span><span class="src-var">$char</span> == <span class="src-var">$STRING_OPEN</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1559"></a><br />1559                              <span class="src-comm">// A match of a string delimiter</span><a name="a1560"></a><br />1560                              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span> &amp;&amp; <span class="src-var">$ESCAPE_CHAR_OPEN</span><span class="src-sym">)</span> ||<a name="a1561"></a><br />1561                                  <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span> &amp;&amp; <span class="src-sym">!</span><span class="src-var">$ESCAPE_CHAR_OPEN</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1562"></a><br />1562                                  <span class="src-var">$char</span> .= <span class="src-str">'&lt;/span&gt;'</span>;<a name="a1563"></a><br />1563                              <span class="src-sym">}</span><a name="a1564"></a><br />1564                              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$ESCAPE_CHAR_OPEN</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1565"></a><br />1565                                  <span class="src-var">$STRING_OPEN</span> = <span class="src-str">''</span>;<a name="a1566"></a><br />1566                                  <span class="src-var">$CLOSE_STRING</span> = <span class="src-id">true</span>;<a name="a1567"></a><br />1567                              <span class="src-sym">}</span><a name="a1568"></a><br />1568                              <span class="src-var">$ESCAPE_CHAR_OPEN</span> = <span class="src-id">false</span>;<a name="a1569"></a><br />1569                          <span class="src-sym">}</span> <span class="src-key">elseif</span> <span class="src-sym">(</span><a href="http://www.php.net/in_array">in_array</a><span class="src-sym">(</span><span class="src-var">$char</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'QUOTEMARKS'</span><span class="src-sym">]</span><span class="src-sym">)</span> &amp;&amp;<a name="a1570"></a><br />1570                              <span class="src-sym">(</span><span class="src-var">$STRING_OPEN</span> == <span class="src-str">''</span><span class="src-sym">)</span> &amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1571"></a><br />1571                              <span class="src-comm">// The start of a new string</span><a name="a1572"></a><br />1572                              <span class="src-var">$STRING_OPEN</span> = <span class="src-var">$char</span>;<a name="a1573"></a><br />1573                              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1574"></a><br />1574                                  <span class="src-var">$attributes</span> = <span class="src-str">' style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> . <span class="src-str">'&quot;'</span>;<a name="a1575"></a><br />1575                              <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1576"></a><br />1576                                  <span class="src-var">$attributes</span> = <span class="src-str">' class=&quot;st0&quot;'</span>;<a name="a1577"></a><br />1577                              <span class="src-sym">}</span><a name="a1578"></a><br />1578                              <span class="src-var">$char</span> = &quot;<span class="src-str">&lt;<span class="src-id">span</span><span class="src-var">$attributes</span>&gt;</span>&quot; . <span class="src-var">$char</span>;<a name="a1579"></a><br />1579  <a name="a1580"></a><br />1580                              <span class="src-var">$result</span> .= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">parse_non_string_part</span><span class="src-sym">(</span> <span class="src-var">$stuff_to_parse</span> <span class="src-sym">)</span>;<a name="a1581"></a><br />1581                              <span class="src-var">$stuff_to_parse</span> = <span class="src-str">''</span>;<a name="a1582"></a><br />1582                          <span class="src-sym">}</span> <span class="src-key">elseif</span> <span class="src-sym">(</span><span class="src-sym">(</span><span class="src-var">$char</span> == <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">)</span> &amp;&amp; <span class="src-sym">(</span><span class="src-var">$STRING_OPEN</span> != <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1583"></a><br />1583                              <span class="src-comm">// An escape character</span><a name="a1584"></a><br />1584                              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$ESCAPE_CHAR_OPEN</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1585"></a><br />1585                                  <span class="src-var">$ESCAPE_CHAR_OPEN</span> = <span class="src-id">true</span>;<a name="a1586"></a><br />1586                                  <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1587"></a><br />1587                                      <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1588"></a><br />1588                                          <span class="src-var">$attributes</span> = <span class="src-str">' style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> . <span class="src-str">'&quot;'</span>;<a name="a1589"></a><br />1589                                      <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1590"></a><br />1590                                          <span class="src-var">$attributes</span> = <span class="src-str">' class=&quot;es0&quot;'</span>;<a name="a1591"></a><br />1591                                      <span class="src-sym">}</span><a name="a1592"></a><br />1592                                      <span class="src-var">$char</span> = &quot;<span class="src-str">&lt;<span class="src-id">span</span><span class="src-var">$attributes</span>&gt;</span>&quot; . <span class="src-var">$char</span>;<a name="a1593"></a><br />1593                                  <span class="src-sym">}</span><a name="a1594"></a><br />1594                              <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1595"></a><br />1595                                  <span class="src-var">$ESCAPE_CHAR_OPEN</span> = <span class="src-id">false</span>;<a name="a1596"></a><br />1596                                  <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1597"></a><br />1597                                      <span class="src-var">$char</span> .= <span class="src-str">'&lt;/span&gt;'</span>;<a name="a1598"></a><br />1598                                  <span class="src-sym">}</span><a name="a1599"></a><br />1599                              <span class="src-sym">}</span><a name="a1600"></a><br />1600                          <span class="src-sym">}</span> <span class="src-key">elseif</span> <span class="src-sym">(</span><span class="src-var">$ESCAPE_CHAR_OPEN</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1601"></a><br />1601                              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1602"></a><br />1602                                  <span class="src-var">$char</span> .= <span class="src-str">'&lt;/span&gt;'</span>;<a name="a1603"></a><br />1603                              <span class="src-sym">}</span><a name="a1604"></a><br />1604                              <span class="src-var">$ESCAPE_CHAR_OPEN</span> = <span class="src-id">false</span>;<a name="a1605"></a><br />1605                              <span class="src-var">$test_str</span> = <span class="src-var">$char</span>;<a name="a1606"></a><br />1606                          <span class="src-sym">}</span> <span class="src-key">elseif</span> <span class="src-sym">(</span><span class="src-var">$STRING_OPEN</span> == <span class="src-str">''</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1607"></a><br />1607                              <span class="src-comm">// Is this a multiline comment?</span><a name="a1608"></a><br />1608                              <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'COMMENT_MULTI'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$open</span> =&gt; <span class="src-var">$close</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1609"></a><br />1609                                  <span class="src-var">$com_len</span> = <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$open</span><span class="src-sym">)</span>;<a name="a1610"></a><br />1610                                  <span class="src-var">$test_str</span> = <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span> <span class="src-var">$part</span><span class="src-sym">,</span> <span class="src-var">$i</span><span class="src-sym">,</span> <span class="src-var">$com_len</span> <span class="src-sym">)</span>;<a name="a1611"></a><br />1611                                  <span class="src-var">$test_str_match</span> = <span class="src-var">$test_str</span>;<a name="a1612"></a><br />1612                                  <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$open</span> == <span class="src-var">$test_str</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1613"></a><br />1613                                      <span class="src-var">$COMMENT_MATCHED</span> = <span class="src-id">true</span>;<a name="a1614"></a><br />1614                                      <span class="src-comm">//@todo If remove important do remove here</span><a name="a1615"></a><br />1615                                      <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'MULTI'</span><span class="src-sym">]</span> ||<a name="a1616"></a><br />1616                                          <span class="src-var">$test_str</span> == <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_START_IMPORTANT">GESHI_START_IMPORTANT</a></span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1617"></a><br />1617                                          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$test_str</span> != <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_START_IMPORTANT">GESHI_START_IMPORTANT</a></span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1618"></a><br />1618                                              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1619"></a><br />1619                                                  <span class="src-var">$attributes</span> = <span class="src-str">' style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'MULTI'</span><span class="src-sym">]</span> . <span class="src-str">'&quot;'</span>;<a name="a1620"></a><br />1620                                              <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1621"></a><br />1621                                                  <span class="src-var">$attributes</span> = <span class="src-str">' class=&quot;coMULTI&quot;'</span>;<a name="a1622"></a><br />1622                                              <span class="src-sym">}</span><a name="a1623"></a><br />1623                                              <span class="src-var">$test_str</span> = &quot;<span class="src-str">&lt;<span class="src-id">span</span><span class="src-var">$attributes</span>&gt;</span>&quot; . <span class="src-sym">@</span><a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-var">$test_str</span><span class="src-sym">,</span> <span class="src-id">ENT_COMPAT</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span><span class="src-sym">)</span>;<a name="a1624"></a><br />1624                                          <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1625"></a><br />1625                                              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1626"></a><br />1626                                                  <span class="src-var">$attributes</span> = <span class="src-str">' style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">important_styles</span> . <span class="src-str">'&quot;'</span>;<a name="a1627"></a><br />1627                                              <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1628"></a><br />1628                                                  <span class="src-var">$attributes</span> = <span class="src-str">' class=&quot;imp&quot;'</span>;<a name="a1629"></a><br />1629                                              <span class="src-sym">}</span><a name="a1630"></a><br />1630                                              <span class="src-comm">// We don't include the start of the comment if it's an</span><a name="a1631"></a><br />1631                                              <span class="src-comm">// &quot;important&quot; part</span><a name="a1632"></a><br />1632                                              <span class="src-var">$test_str</span> = &quot;<span class="src-str">&lt;<span class="src-id">span</span><span class="src-var">$attributes</span>&gt;</span>&quot;;<a name="a1633"></a><br />1633                                          <span class="src-sym">}</span><a name="a1634"></a><br />1634                                      <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1635"></a><br />1635                                          <span class="src-var">$test_str</span> = <span class="src-sym">@</span><a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-var">$test_str</span><span class="src-sym">,</span> <span class="src-id">ENT_COMPAT</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span><span class="src-sym">)</span>;<a name="a1636"></a><br />1636                                      <span class="src-sym">}</span><a name="a1637"></a><br />1637  <a name="a1638"></a><br />1638                                      <span class="src-var">$close_pos</span> = <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span> <span class="src-var">$part</span><span class="src-sym">,</span> <span class="src-var">$close</span><span class="src-sym">,</span> <span class="src-var">$i</span> + <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$close</span><span class="src-sym">)</span> <span class="src-sym">)</span>;<a name="a1639"></a><br />1639  <a name="a1640"></a><br />1640                                      <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$close_pos</span> === <span class="src-id">false</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1641"></a><br />1641                                          <span class="src-var">$close_pos</span> = <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">)</span>;<a name="a1642"></a><br />1642                                      <span class="src-sym">}</span><a name="a1643"></a><br />1643  <a name="a1644"></a><br />1644                                      <span class="src-comm">// Short-cut through all the multiline code</span><a name="a1645"></a><br />1645                                      <span class="src-var">$rest_of_comment</span> = <span class="src-sym">@</span><a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span> <span class="src-var">$i</span> + <span class="src-var">$com_len</span><span class="src-sym">,</span> <span class="src-var">$close_pos</span> - <span class="src-var">$i</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-id">ENT_COMPAT</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span><span class="src-sym">)</span>;<a name="a1646"></a><br />1646                                      <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'MULTI'</span><span class="src-sym">]</span> ||<a name="a1647"></a><br />1647                                          <span class="src-var">$test_str_match</span> == <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_START_IMPORTANT">GESHI_START_IMPORTANT</a></span><span class="src-sym">)</span> &amp;&amp;<a name="a1648"></a><br />1648                                          <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_numbers</span> != <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_NO_LINE_NUMBERS">GESHI_NO_LINE_NUMBERS</a></span> ||<a name="a1649"></a><br />1649                                          <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines</span><span class="src-sym">)</span> &gt; <span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1650"></a><br />1650                                          <span class="src-comm">// strreplace to put close span and open span around multiline newlines</span><a name="a1651"></a><br />1651                                          <span class="src-var">$test_str</span> .= <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span> &quot;<span class="src-str">&lt;/<span class="src-id">span</span>&gt;\n&lt;<span class="src-id">span</span><span class="src-var">$attributes</span>&gt;</span>&quot;<span class="src-sym">,</span> <span class="src-var">$rest_of_comment</span><span class="src-sym">)</span>;<a name="a1652"></a><br />1652                                      <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1653"></a><br />1653                                          <span class="src-var">$test_str</span> .= <span class="src-var">$rest_of_comment</span>;<a name="a1654"></a><br />1654                                      <span class="src-sym">}</span><a name="a1655"></a><br />1655  <a name="a1656"></a><br />1656                                      <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'MULTI'</span><span class="src-sym">]</span> ||<a name="a1657"></a><br />1657                                          <span class="src-var">$test_str_match</span> == <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_START_IMPORTANT">GESHI_START_IMPORTANT</a></span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1658"></a><br />1658                                          <span class="src-var">$test_str</span> .= <span class="src-str">'&lt;/span&gt;'</span>;<a name="a1659"></a><br />1659                                      <span class="src-sym">}</span><a name="a1660"></a><br />1660                                      <span class="src-var">$i</span> = <span class="src-var">$close_pos</span> + <span class="src-var">$com_len</span> - <span class="src-num">1</span>;<a name="a1661"></a><br />1661                                      <span class="src-comm">// parse the rest</span><a name="a1662"></a><br />1662                                      <span class="src-var">$result</span> .= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">parse_non_string_part</span><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span>;<a name="a1663"></a><br />1663                                      <span class="src-var">$stuff_to_parse</span> = <span class="src-str">''</span>;<a name="a1664"></a><br />1664                                      <span class="src-key">break</span>;<a name="a1665"></a><br />1665                                  <span class="src-sym">}</span><a name="a1666"></a><br />1666                              <span class="src-sym">}</span><a name="a1667"></a><br />1667                              <span class="src-comm">// If we haven't matched a multiline comment, try single-line comments</span><a name="a1668"></a><br />1668                              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$COMMENT_MATCHED</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1669"></a><br />1669                                  <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'COMMENT_SINGLE'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$comment_key</span> =&gt; <span class="src-var">$comment_mark</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1670"></a><br />1670                                      <span class="src-var">$com_len</span> = <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$comment_mark</span><span class="src-sym">)</span>;<a name="a1671"></a><br />1671                                      <span class="src-var">$test_str</span> = <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span> <span class="src-var">$i</span><span class="src-sym">,</span> <span class="src-var">$com_len</span><span class="src-sym">)</span>;<a name="a1672"></a><br />1672                                      <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CASE_SENSITIVE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-id">GESHI_COMMENTS</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1673"></a><br />1673                                          <span class="src-var">$match</span> = <span class="src-sym">(</span><span class="src-var">$comment_mark</span> == <span class="src-var">$test_str</span><span class="src-sym">)</span>;<a name="a1674"></a><br />1674                                      <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1675"></a><br />1675                                          <span class="src-var">$match</span> = <span class="src-sym">(</span><a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$comment_mark</span><span class="src-sym">)</span> == <a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$test_str</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a1676"></a><br />1676                                      <span class="src-sym">}</span><a name="a1677"></a><br />1677                                      <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$match</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1678"></a><br />1678                                          <span class="src-var">$COMMENT_MATCHED</span> = <span class="src-id">true</span>;<a name="a1679"></a><br />1679                                          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1680"></a><br />1680                                              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1681"></a><br />1681                                                  <span class="src-var">$attributes</span> = <span class="src-str">' style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span> . <span class="src-str">'&quot;'</span>;<a name="a1682"></a><br />1682                                              <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1683"></a><br />1683                                                  <span class="src-var">$attributes</span> = <span class="src-str">' class=&quot;co'</span> . <span class="src-var">$comment_key</span> . <span class="src-str">'&quot;'</span>;<a name="a1684"></a><br />1684                                              <span class="src-sym">}</span><a name="a1685"></a><br />1685                                              <span class="src-var">$test_str</span> = &quot;<span class="src-str">&lt;<span class="src-id">span</span><span class="src-var">$attributes</span>&gt;</span>&quot; . <span class="src-sym">@</span><a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">change_case</span><span class="src-sym">(</span><span class="src-var">$test_str</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-id">ENT_COMPAT</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span><span class="src-sym">)</span>;<a name="a1686"></a><br />1686                                          <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1687"></a><br />1687                                              <span class="src-var">$test_str</span> = <span class="src-sym">@</span><a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-var">$test_str</span><span class="src-sym">,</span> <span class="src-id">ENT_COMPAT</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span><span class="src-sym">)</span>;<a name="a1688"></a><br />1688                                          <span class="src-sym">}</span><a name="a1689"></a><br />1689                                          <span class="src-var">$close_pos</span> = <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span> <span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span> <span class="src-var">$i</span><span class="src-sym">)</span>;<a name="a1690"></a><br />1690                                          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$close_pos</span> === <span class="src-id">false</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1691"></a><br />1691                                              <span class="src-var">$close_pos</span> = <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">)</span>;<a name="a1692"></a><br />1692                                          <span class="src-sym">}</span><a name="a1693"></a><br />1693                                          <span class="src-var">$test_str</span> .= <span class="src-sym">@</span><a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span> <span class="src-var">$i</span> + <span class="src-var">$com_len</span><span class="src-sym">,</span> <span class="src-var">$close_pos</span> - <span class="src-var">$i</span> - <span class="src-var">$com_len</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-id">ENT_COMPAT</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span><span class="src-sym">)</span>;<a name="a1694"></a><br />1694                                          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1695"></a><br />1695                                              <span class="src-var">$test_str</span> .= <span class="src-str">&quot;&lt;/span&gt;&quot;</span>;<a name="a1696"></a><br />1696                                          <span class="src-sym">}</span><a name="a1697"></a><br />1697                                          <span class="src-var">$test_str</span> .= <span class="src-str">&quot;\n&quot;</span>;<a name="a1698"></a><br />1698                                          <span class="src-var">$i</span> = <span class="src-var">$close_pos</span>;<a name="a1699"></a><br />1699                                          <span class="src-comm">// parse the rest</span><a name="a1700"></a><br />1700                                          <span class="src-var">$result</span> .= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">parse_non_string_part</span><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span>;<a name="a1701"></a><br />1701                                          <span class="src-var">$stuff_to_parse</span> = <span class="src-str">''</span>;<a name="a1702"></a><br />1702                                          <span class="src-key">break</span>;<a name="a1703"></a><br />1703                                      <span class="src-sym">}</span><a name="a1704"></a><br />1704                                  <span class="src-sym">}</span><a name="a1705"></a><br />1705                              <span class="src-sym">}</span><a name="a1706"></a><br />1706                          <span class="src-sym">}</span> <span class="src-key">elseif</span> <span class="src-sym">(</span><span class="src-var">$STRING_OPEN</span> != <span class="src-str">''</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1707"></a><br />1707                              <span class="src-comm">// Otherwise, convert it to HTML form</span><a name="a1708"></a><br />1708                              <span class="src-key">if</span> <span class="src-sym">(</span><a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span><span class="src-sym">)</span> == <span class="src-str">'utf-8'</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1709"></a><br />1709                                  <span class="src-comm">//only escape &lt;128 (we don't want to break multibyte chars)</span><a name="a1710"></a><br />1710                                  <span class="src-key">if</span> <span class="src-sym">(</span><a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$char</span><span class="src-sym">)</span> &lt; <span class="src-num">128</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1711"></a><br />1711                                      <span class="src-var">$char</span> = <span class="src-sym">@</span><a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-var">$char</span><span class="src-sym">,</span> <span class="src-id">ENT_COMPAT</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span><span class="src-sym">)</span>;<a name="a1712"></a><br />1712                                  <span class="src-sym">}</span><a name="a1713"></a><br />1713                              <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1714"></a><br />1714                                  <span class="src-comm">//encode everthing</span><a name="a1715"></a><br />1715                                  <span class="src-var">$char</span> = <span class="src-sym">@</span><a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-var">$char</span><span class="src-sym">,</span> <span class="src-id">ENT_COMPAT</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span><span class="src-sym">)</span>;<a name="a1716"></a><br />1716                              <span class="src-sym">}</span><a name="a1717"></a><br />1717                          <span class="src-sym">}</span><a name="a1718"></a><br />1718                          <span class="src-comm">// Where are we adding this char?</span><a name="a1719"></a><br />1719                          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$COMMENT_MATCHED</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1720"></a><br />1720                              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">(</span><span class="src-var">$STRING_OPEN</span> == <span class="src-str">''</span><span class="src-sym">)</span> &amp;&amp; <span class="src-sym">!</span><span class="src-var">$CLOSE_STRING</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1721"></a><br />1721                                  <span class="src-var">$stuff_to_parse</span> .= <span class="src-var">$char</span>;<a name="a1722"></a><br />1722                              <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1723"></a><br />1723                                  <span class="src-var">$result</span> .= <span class="src-var">$char</span>;<a name="a1724"></a><br />1724                                  <span class="src-var">$CLOSE_STRING</span> = <span class="src-id">false</span>;<a name="a1725"></a><br />1725                              <span class="src-sym">}</span><a name="a1726"></a><br />1726                          <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1727"></a><br />1727                              <span class="src-var">$result</span> .= <span class="src-var">$test_str</span>;<a name="a1728"></a><br />1728                              <span class="src-var">$COMMENT_MATCHED</span> = <span class="src-id">false</span>;<a name="a1729"></a><br />1729                          <span class="src-sym">}</span><a name="a1730"></a><br />1730                      <span class="src-sym">}</span><a name="a1731"></a><br />1731                      <span class="src-comm">// Parse the last bit</span><a name="a1732"></a><br />1732                      <span class="src-var">$result</span> .= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">parse_non_string_part</span><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span>;<a name="a1733"></a><br />1733                      <span class="src-var">$stuff_to_parse</span> = <span class="src-str">''</span>;<a name="a1734"></a><br />1734                  <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1735"></a><br />1735                      <span class="src-var">$result</span> .= <span class="src-sym">@</span><a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span> <span class="src-id">ENT_COMPAT</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span><span class="src-sym">)</span>;<a name="a1736"></a><br />1736                  <span class="src-sym">}</span><a name="a1737"></a><br />1737                  <span class="src-comm">// Close the &lt;span&gt; that surrounds the block</span><a name="a1738"></a><br />1738                  <span class="src-comm">// Removed since the only time this is used is for php and it doesn't need a &lt;/span&gt;</span><a name="a1739"></a><br />1739                  <span class="src-comm">/*if ($this-&gt;strict_mode &amp;&amp; $this-&gt;lexic_permissions['SCRIPT']) {</span><a name="a1740"></a><br />1740  <span class="src-comm">					$result .= '&lt;/span&gt;';</span><a name="a1741"></a><br />1741  <span class="src-comm">				}*/</span><a name="a1742"></a><br />1742              <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1743"></a><br />1743                  <span class="src-comm">// Else not a block to highlight</span><a name="a1744"></a><br />1744                  <span class="src-var">$result</span> .= <span class="src-sym">@</span><a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span> <span class="src-id">ENT_COMPAT</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span><span class="src-sym">)</span>;<a name="a1745"></a><br />1745              <span class="src-sym">}</span><a name="a1746"></a><br />1746          <span class="src-sym">}</span><a name="a1747"></a><br />1747  <a name="a1748"></a><br />1748          <span class="src-comm">// Parse the last stuff (redundant?)</span><a name="a1749"></a><br />1749          <span class="src-var">$result</span> .= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">parse_non_string_part</span><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span>;<a name="a1750"></a><br />1750  <a name="a1751"></a><br />1751          <span class="src-comm">// Lop off the very first and last spaces</span><a name="a1752"></a><br />1752          <span class="src-var">$result</span> = <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$result</span><span class="src-sym">,</span> <span class="src-num">1</span><span class="src-sym">,</span> <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$result</span><span class="src-sym">)</span> - <span class="src-num">1</span><span class="src-sym">)</span>;<a name="a1753"></a><br />1753  <a name="a1754"></a><br />1754          <span class="src-comm">// Are we still in a string?</span><a name="a1755"></a><br />1755          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$STRING_OPEN</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1756"></a><br />1756              <span class="src-var">$result</span> .= <span class="src-str">'&lt;/span&gt;'</span>;<a name="a1757"></a><br />1757          <span class="src-sym">}</span><a name="a1758"></a><br />1758  <a name="a1759"></a><br />1759          <span class="src-comm">// We're finished: stop timing</span><a name="a1760"></a><br />1760          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">set_time</span><span class="src-sym">(</span><span class="src-var">$start_time</span><span class="src-sym">,</span> <a href="http://www.php.net/microtime">microtime</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a1761"></a><br />1761  <a name="a1762"></a><br />1762          <span class="src-key">return</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">finalise</span><span class="src-sym">(</span><span class="src-var">$result</span><span class="src-sym">)</span>;<a name="a1763"></a><br />1763      <span class="src-sym">}</span><a name="a1764"></a><br />1764  <a name="a1765"></a><br />1765      <span class="src-doc">/**</span><a name="a1766"></a><br />1766  <span class="src-doc">	 * Swaps out spaces and tabs for HTML indentation. Not needed if</span><a name="a1767"></a><br />1767  <span class="src-doc">	 * the code is in a pre block...</span><a name="a1768"></a><br />1768  <span class="src-doc">     * </span><a name="a1769"></a><br />1769  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"> </span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The source to indent</span><a name="a1770"></a><br />1770  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@return </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The source with HTML indenting applied</span><a name="a1771"></a><br />1771  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc">  1.0.0</span><a name="a1772"></a><br />1772  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a1773"></a><br />1773  <span class="src-doc">	 */</span><a name="a1774"></a><br />1774      <span class="src-key">function</span> <span class="src-id">indent</span> <span class="src-sym">(</span><span class="src-var">$result</span><span class="src-sym">)</span><a name="a1775"></a><br />1775      <span class="src-sym">{</span><a name="a1776"></a><br />1776              <span class="src-comm">/// Replace tabs with the correct number of spaces</span><a name="a1777"></a><br />1777              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-id">false</span> !== <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$result</span><span class="src-sym">,</span> <span class="src-str">&quot;\t&quot;</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1778"></a><br />1778                  <span class="src-var">$lines</span> = <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span> <span class="src-var">$result</span><span class="src-sym">)</span>;<a name="a1779"></a><br />1779                  <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$lines</span> <span class="src-key">as</span> <span class="src-var">$key</span> =&gt; <span class="src-var">$line</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1780"></a><br />1780                      <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-id">false</span> === <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$line</span><span class="src-sym">,</span> <span class="src-str">&quot;\t&quot;</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1781"></a><br />1781                          <span class="src-var">$lines</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-var">$line</span>;<a name="a1782"></a><br />1782                          <span class="src-key">continue</span>;<a name="a1783"></a><br />1783                      <span class="src-sym">}</span><span class="src-comm">//echo 'checking line ' . $key . '&lt;br /&gt;';</span><a name="a1784"></a><br />1784  <a name="a1785"></a><br />1785                      <span class="src-var">$pos</span> = <span class="src-num">0</span>;<a name="a1786"></a><br />1786                      <span class="src-var">$tab_width</span> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">tab_width</span>;<a name="a1787"></a><br />1787                      <span class="src-var">$length</span> = <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$line</span><span class="src-sym">)</span>;<a name="a1788"></a><br />1788                      <span class="src-var">$result_line</span> = <span class="src-str">''</span>;<a name="a1789"></a><br />1789  <a name="a1790"></a><br />1790                      <span class="src-comm">//echo '&lt;pre&gt;line: ' . htmlspecialchars($line) . '&lt;/pre&gt;';</span><a name="a1791"></a><br />1791                      <span class="src-var">$IN_TAG</span> = <span class="src-id">false</span>;<a name="a1792"></a><br />1792                      <span class="src-key">for</span> <span class="src-sym">(</span><span class="src-var">$i</span> = <span class="src-num">0</span>; <span class="src-var">$i</span> &lt; <span class="src-var">$length</span>; <span class="src-var">$i</span>++<span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1793"></a><br />1793                          <span class="src-var">$char</span> = <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$line</span><span class="src-sym">,</span> <span class="src-var">$i</span><span class="src-sym">,</span> <span class="src-num">1</span><span class="src-sym">)</span>;<a name="a1794"></a><br />1794                          <span class="src-comm">// Simple engine to work out whether we're in a tag.</span><a name="a1795"></a><br />1795                          <span class="src-comm">// If we are we modify $pos. This is so we ignore HTML</span><a name="a1796"></a><br />1796                          <span class="src-comm">// in the line and only workout the tab replacement</span><a name="a1797"></a><br />1797                          <span class="src-comm">// via the actual content of the string</span><a name="a1798"></a><br />1798                          <span class="src-comm">// This test could be improved to include strings in the</span><a name="a1799"></a><br />1799                          <span class="src-comm">// html so that &lt; or &gt; would be allowed in user's styles</span><a name="a1800"></a><br />1800                          <span class="src-comm">// (e.g. quotes: '&lt;' '&gt;'; or similar)</span><a name="a1801"></a><br />1801                          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$IN_TAG</span> &amp;&amp; <span class="src-str">'&gt;'</span> == <span class="src-var">$char</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1802"></a><br />1802                              <span class="src-var">$IN_TAG</span> = <span class="src-id">false</span>;<a name="a1803"></a><br />1803                              <span class="src-var">$result_line</span> .= <span class="src-str">'&gt;'</span>;<a name="a1804"></a><br />1804                              ++<span class="src-var">$pos</span>;<a name="a1805"></a><br />1805                          <span class="src-sym">}</span> <span class="src-key">elseif</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$IN_TAG</span> &amp;&amp; <span class="src-str">'&lt;'</span> == <span class="src-var">$char</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1806"></a><br />1806                              <span class="src-var">$IN_TAG</span> = <span class="src-id">true</span>;<a name="a1807"></a><br />1807                              <span class="src-var">$result_line</span> .= <span class="src-str">'&lt;'</span>;<a name="a1808"></a><br />1808                              ++<span class="src-var">$pos</span>;<a name="a1809"></a><br />1809                          <span class="src-sym">}</span> <span class="src-key">elseif</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$IN_TAG</span> &amp;&amp; <span class="src-str">'&amp;'</span> == <span class="src-var">$char</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1810"></a><br />1810                              <span class="src-comm">//echo &quot;matched &amp;amp; in line... &quot;;</span><a name="a1811"></a><br />1811                              <span class="src-var">$substr</span> = <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$line</span><span class="src-sym">,</span> <span class="src-var">$i</span> + <span class="src-num">3</span><span class="src-sym">,</span> <span class="src-num">4</span><span class="src-sym">)</span>;<a name="a1812"></a><br />1812                              <span class="src-comm">//$substr_5 = substr($line, 5, 1);</span><a name="a1813"></a><br />1813                              <span class="src-var">$posi</span> = <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$substr</span><span class="src-sym">,</span> <span class="src-str">';'</span><span class="src-sym">)</span>;<a name="a1814"></a><br />1814                              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-id">false</span> !== <span class="src-var">$posi</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1815"></a><br />1815                                  <span class="src-comm">//echo &quot;found entity at $posi\n&quot;;</span><a name="a1816"></a><br />1816                                  <span class="src-var">$pos</span> += <span class="src-var">$posi</span> + <span class="src-num">3</span>;<a name="a1817"></a><br />1817                              <span class="src-sym">}</span><a name="a1818"></a><br />1818                              <span class="src-var">$result_line</span> .= <span class="src-str">'&amp;'</span>;<a name="a1819"></a><br />1819                          <span class="src-sym">}</span> <span class="src-key">elseif</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$IN_TAG</span> &amp;&amp; <span class="src-str">&quot;\t&quot;</span> == <span class="src-var">$char</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1820"></a><br />1820                              <span class="src-var">$str</span> = <span class="src-str">''</span>;<a name="a1821"></a><br />1821                              <span class="src-comm">// OPTIMISE - move $strs out. Make an array:</span><a name="a1822"></a><br />1822                              <span class="src-comm">// $tabs = array(</span><a name="a1823"></a><br />1823                              <span class="src-comm">//  1 =&gt; '&amp;nbsp;',</span><a name="a1824"></a><br />1824                              <span class="src-comm">//  2 =&gt; '&amp;nbsp; ',</span><a name="a1825"></a><br />1825                              <span class="src-comm">//  3 =&gt; '&amp;nbsp; &amp;nbsp;' etc etc</span><a name="a1826"></a><br />1826                              <span class="src-comm">// to use instead of building a string every time</span><a name="a1827"></a><br />1827                              <span class="src-var">$strs</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-num">0</span> =&gt; <span class="src-str">'&amp;nbsp;'</span><span class="src-sym">,</span> <span class="src-num">1</span> =&gt; <span class="src-str">' '</span><span class="src-sym">)</span>;<a name="a1828"></a><br />1828                              <span class="src-comm">//echo &quot;building (pos=$pos i=$i) (&quot; . ($i - $pos) . &quot;) &quot; . ($tab_width - (($i - $pos) % $tab_width)) . &quot; spaces\n&quot;;</span><a name="a1829"></a><br />1829                              <span class="src-key">for</span> <span class="src-sym">(</span><span class="src-var">$k</span> = <span class="src-num">0</span>; <span class="src-var">$k</span> &lt; <span class="src-sym">(</span><span class="src-var">$tab_width</span> - <span class="src-sym">(</span><span class="src-sym">(</span><span class="src-var">$i</span> - <span class="src-var">$pos</span><span class="src-sym">)</span> % <span class="src-var">$tab_width</span><span class="src-sym">)</span><span class="src-sym">)</span>; <span class="src-var">$k</span>++<span class="src-sym">)</span> <span class="src-var">$str</span> .= <span class="src-var">$strs</span><span class="src-sym">[</span><span class="src-var">$k</span> % <span class="src-num">2</span><span class="src-sym">]</span>;<a name="a1830"></a><br />1830                              <span class="src-var">$result_line</span> .= <span class="src-var">$str</span>;<a name="a1831"></a><br />1831                              <span class="src-comm">//$pos--;</span><a name="a1832"></a><br />1832                              <span class="src-var">$pos</span>++;<a name="a1833"></a><br />1833                              <span class="src-comm">//$pos -= $tab_width-1;</span><a name="a1834"></a><br />1834  <a name="a1835"></a><br />1835                              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-id">false</span> === <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$line</span><span class="src-sym">,</span> <span class="src-str">&quot;\t&quot;</span><span class="src-sym">,</span> <span class="src-var">$i</span> + <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1836"></a><br />1836                                  <span class="src-comm">//$lines[$key] = $result_line;</span><a name="a1837"></a><br />1837                                  <span class="src-comm">//echo 'got here';</span><a name="a1838"></a><br />1838                                  <span class="src-var">$result_line</span> .= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$line</span><span class="src-sym">,</span> <span class="src-var">$i</span> + <span class="src-num">1</span><span class="src-sym">)</span>;<a name="a1839"></a><br />1839                                  <span class="src-key">break</span>;<a name="a1840"></a><br />1840                              <span class="src-sym">}</span><a name="a1841"></a><br />1841                          <span class="src-sym">}</span> <span class="src-key">elseif</span> <span class="src-sym">(</span> <span class="src-var">$IN_TAG</span> <span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1842"></a><br />1842                              ++<span class="src-var">$pos</span>;<a name="a1843"></a><br />1843                              <span class="src-var">$result_line</span> .= <span class="src-var">$char</span>;<a name="a1844"></a><br />1844                          <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1845"></a><br />1845                              <span class="src-var">$result_line</span> .= <span class="src-var">$char</span>;<a name="a1846"></a><br />1846                              <span class="src-comm">//++$pos;</span><a name="a1847"></a><br />1847                          <span class="src-sym">}</span><a name="a1848"></a><br />1848                      <span class="src-sym">}</span><a name="a1849"></a><br />1849                      <span class="src-var">$lines</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-var">$result_line</span>;<a name="a1850"></a><br />1850                  <span class="src-sym">}</span><a name="a1851"></a><br />1851                  <span class="src-var">$result</span> = <a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span> <span class="src-var">$lines</span><span class="src-sym">)</span>;<a name="a1852"></a><br />1852              <span class="src-sym">}</span><a name="a1853"></a><br />1853          <span class="src-comm">// Other whitespace</span><a name="a1854"></a><br />1854          <span class="src-var">$result</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'  '</span><span class="src-sym">,</span> <span class="src-str">'&amp;nbsp; '</span><span class="src-sym">,</span> <span class="src-var">$result</span><span class="src-sym">)</span>;<a name="a1855"></a><br />1855          <span class="src-var">$result</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'  '</span><span class="src-sym">,</span> <span class="src-str">' &amp;nbsp;'</span><span class="src-sym">,</span> <span class="src-var">$result</span><span class="src-sym">)</span>;<a name="a1856"></a><br />1856          <span class="src-var">$result</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\n &quot;</span><span class="src-sym">,</span> <span class="src-str">&quot;\n&amp;nbsp;&quot;</span><span class="src-sym">,</span> <span class="src-var">$result</span><span class="src-sym">)</span>;<a name="a1857"></a><br />1857  <a name="a1858"></a><br />1858          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_numbers</span> == <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_NO_LINE_NUMBERS">GESHI_NO_LINE_NUMBERS</a></span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1859"></a><br />1859              <span class="src-var">$result</span> = <a href="http://www.php.net/nl2br">nl2br</a><span class="src-sym">(</span><span class="src-var">$result</span><span class="src-sym">)</span>;<a name="a1860"></a><br />1860          <span class="src-sym">}</span><a name="a1861"></a><br />1861          <span class="src-key">return</span> <span class="src-var">$result</span>;<a name="a1862"></a><br />1862      <span class="src-sym">}</span><a name="a1863"></a><br />1863  <a name="a1864"></a><br />1864      <span class="src-doc">/**</span><a name="a1865"></a><br />1865  <span class="src-doc">	 * Changes the case of a keyword for those languages where a change is asked for</span><a name="a1866"></a><br />1866  <span class="src-doc">     * </span><a name="a1867"></a><br />1867  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"> </span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The keyword to change the case of</span><a name="a1868"></a><br />1868  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@return </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The keyword with its case changed</span><a name="a1869"></a><br />1869  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc">  1.0.0</span><a name="a1870"></a><br />1870  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a1871"></a><br />1871  <span class="src-doc">	 */</span><a name="a1872"></a><br />1872      <span class="src-key">function</span> <span class="src-id">change_case</span> <span class="src-sym">(</span><span class="src-var">$instr</span><span class="src-sym">)</span><a name="a1873"></a><br />1873      <span class="src-sym">{</span><a name="a1874"></a><br />1874          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CASE_KEYWORDS'</span><span class="src-sym">]</span> == <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_CAPS_UPPER">GESHI_CAPS_UPPER</a></span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1875"></a><br />1875              <span class="src-key">return</span> <a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><span class="src-var">$instr</span><span class="src-sym">)</span>;<a name="a1876"></a><br />1876          <span class="src-sym">}</span> <span class="src-key">elseif</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CASE_KEYWORDS'</span><span class="src-sym">]</span> == <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_CAPS_LOWER">GESHI_CAPS_LOWER</a></span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1877"></a><br />1877              <span class="src-key">return</span> <a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$instr</span><span class="src-sym">)</span>;<a name="a1878"></a><br />1878          <span class="src-sym">}</span><a name="a1879"></a><br />1879          <span class="src-key">return</span> <span class="src-var">$instr</span>;<a name="a1880"></a><br />1880      <span class="src-sym">}</span><a name="a1881"></a><br />1881  <a name="a1882"></a><br />1882      <span class="src-doc">/**</span><a name="a1883"></a><br />1883  <span class="src-doc">	 * Adds a url to a keyword where needed.</span><a name="a1884"></a><br />1884  <span class="src-doc">	 * </span><a name="a1885"></a><br />1885  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"> </span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The keyword to add the URL HTML to</span><a name="a1886"></a><br />1886  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"> </span><span class="src-doc-type">int </span><span class="src-doc"></span><span class="src-doc">What group the keyword is from</span><a name="a1887"></a><br />1887  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"> </span><span class="src-doc-type">boolean </span><span class="src-doc"></span><span class="src-doc">Whether to get the HTML for the start or end</span><a name="a1888"></a><br />1888  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@return </span><span class="src-doc"></span><span class="src-doc-type">The </span><span class="src-doc"></span><span class="src-doc">HTML for either the start or end of the HTML &amp;lt;a&amp;gt; tag</span><a name="a1889"></a><br />1889  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc">  1.0.2</span><a name="a1890"></a><br />1890  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a1891"></a><br />1891  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@todo</span><span class="src-doc">   Get rid of ender</span><a name="a1892"></a><br />1892  <span class="src-doc">	 */</span><a name="a1893"></a><br />1893      <span class="src-key">function</span> <span class="src-id">add_url_to_keyword</span> <span class="src-sym">(</span><span class="src-var">$keyword</span><span class="src-sym">,</span> <span class="src-var">$group</span><span class="src-sym">,</span> <span class="src-var">$start_or_end</span><span class="src-sym">)</span><a name="a1894"></a><br />1894      <span class="src-sym">{</span><a name="a1895"></a><br />1895          <span class="src-key">if</span> <span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'URLS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span><span class="src-sym">)</span> &amp;&amp;<a name="a1896"></a><br />1896              <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'URLS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span> != <span class="src-str">''</span> &amp;&amp;<a name="a1897"></a><br />1897              <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$keyword</span><span class="src-sym">,</span> <span class="src-num">0</span><span class="src-sym">,</span> <span class="src-num">5</span><span class="src-sym">)</span> != <span class="src-str">'&amp;lt;/'</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1898"></a><br />1898              <span class="src-comm">// There is a base group for this keyword</span><a name="a1899"></a><br />1899              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$start_or_end</span> == <span class="src-str">'BEGIN'</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1900"></a><br />1900                  <span class="src-comm">// HTML workaround... not good form (tm) but should work for 1.0.X</span><a name="a1901"></a><br />1901                  <span class="src-var">$keyword</span> = <span class="src-sym">(</span> <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$keyword</span><span class="src-sym">,</span> <span class="src-num">0</span><span class="src-sym">,</span> <span class="src-num">4</span><span class="src-sym">)</span> == <span class="src-str">'&amp;lt;'</span> <span class="src-sym">)</span> ? <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$keyword</span><span class="src-sym">,</span> <span class="src-num">4</span><span class="src-sym">)</span> : <span class="src-var">$keyword</span>;<a name="a1902"></a><br />1902                  <span class="src-var">$keyword</span> = <span class="src-sym">(</span> <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$keyword</span><span class="src-sym">,</span> -<span class="src-num">4</span><span class="src-sym">)</span> == <span class="src-str">'&amp;gt;'</span> <span class="src-sym">)</span> ? <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$keyword</span><span class="src-sym">,</span> <span class="src-num">0</span><span class="src-sym">,</span> <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$keyword</span><span class="src-sym">)</span> - <span class="src-num">4</span><span class="src-sym">)</span> : <span class="src-var">$keyword</span>;<a name="a1903"></a><br />1903                  <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$keyword</span> != <span class="src-str">''</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1904"></a><br />1904                      <span class="src-var">$keyword</span> = <span class="src-sym">(</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CASE_SENSITIVE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span> <span class="src-sym">)</span> ? <span class="src-var">$keyword</span> : <a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$keyword</span><span class="src-sym">)</span>;<a name="a1905"></a><br />1905                      <span class="src-key">return</span> <span class="src-str">'&lt;|UR1|&quot;'</span> .<a name="a1906"></a><br />1906                          <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><a name="a1907"></a><br />1907                              <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'{FNAME}'</span><span class="src-sym">,</span> <span class="src-str">'.'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1908"></a><br />1908                              <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">@</span><a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-var">$keyword</span><span class="src-sym">,</span> <span class="src-id">ENT_COMPAT</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-str">'&lt;DOT&gt;'</span><span class="src-sym">)</span><span class="src-sym">,</span><a name="a1909"></a><br />1909                              <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'URLS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span><a name="a1910"></a><br />1910                          <span class="src-sym">)</span> . <span class="src-str">'&quot;&gt;'</span>;<a name="a1911"></a><br />1911                  <span class="src-sym">}</span><a name="a1912"></a><br />1912                  <span class="src-key">return</span> <span class="src-str">''</span>;<a name="a1913"></a><br />1913              <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1914"></a><br />1914                  <span class="src-key">return</span> <span class="src-str">'&lt;/a&gt;'</span>;<a name="a1915"></a><br />1915              <span class="src-sym">}</span><a name="a1916"></a><br />1916          <span class="src-sym">}</span><a name="a1917"></a><br />1917      <span class="src-sym">}</span><a name="a1918"></a><br />1918  <a name="a1919"></a><br />1919      <span class="src-doc">/**</span><a name="a1920"></a><br />1920  <span class="src-doc">	 * Takes a string that has no strings or comments in it, and highlights</span><a name="a1921"></a><br />1921  <span class="src-doc">	 * stuff like keywords, numbers and methods.</span><a name="a1922"></a><br />1922  <span class="src-doc">     * </span><a name="a1923"></a><br />1923  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The string to parse for keyword, numbers etc.</span><a name="a1924"></a><br />1924  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.0</span><a name="a1925"></a><br />1925  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a1926"></a><br />1926  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@todo</span><span class="src-doc"> BUGGY! Why? Why not build string and return?</span><a name="a1927"></a><br />1927  <span class="src-doc">	 */</span><a name="a1928"></a><br />1928      <span class="src-key">function</span> <span class="src-id">parse_non_string_part</span> <span class="src-sym">(</span><span class="src-sym">&amp;</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><a name="a1929"></a><br />1929      <span class="src-sym">{</span><a name="a1930"></a><br />1930          <span class="src-var">$stuff_to_parse</span> = <span class="src-str">' '</span> . <a href="http://www.php.net/quotemeta">quotemeta</a><span class="src-sym">(</span><span class="src-sym">@</span><a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">,</span> <span class="src-id">ENT_COMPAT</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a1931"></a><br />1931          <span class="src-comm">// These vars will disappear in the future</span><a name="a1932"></a><br />1932          <span class="src-var">$func</span> = <span class="src-str">'$this-&gt;change_case'</span>;<a name="a1933"></a><br />1933          <span class="src-var">$func2</span> = <span class="src-str">'$this-&gt;add_url_to_keyword'</span>;<a name="a1934"></a><br />1934  <a name="a1935"></a><br />1935          <span class="src-comm">//</span><a name="a1936"></a><br />1936          <span class="src-comm">// Regular expressions</span><a name="a1937"></a><br />1937          <span class="src-comm">//</span><a name="a1938"></a><br />1938          <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$key</span> =&gt; <span class="src-var">$regexp</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1939"></a><br />1939              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1940"></a><br />1940                  <span class="src-key">if</span> <span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$regexp</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1941"></a><br />1941                      <span class="src-var">$stuff_to_parse</span> = <a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span><a name="a1942"></a><br />1942                          <span class="src-str">&quot;#&quot;</span> .<a name="a1943"></a><br />1943                          <span class="src-var">$regexp</span><span class="src-sym">[</span><span class="src-id">GESHI_SEARCH</span><span class="src-sym">]</span> .<a name="a1944"></a><br />1944                          &quot;<span class="src-str">#{<span class="src-var">$regexp</span><span class="src-sym">[</span><span class="src-id">GESHI_MODIFIERS</span><span class="src-sym">]</span><span class="src-sym">}</span></span>&quot;<span class="src-sym">,</span><a name="a1945"></a><br />1945                          &quot;{<span class="src-var">$regexp</span><span class="src-sym">[</span><span class="src-id">GESHI_BEFORE</span><span class="src-sym">]</span><span class="src-str"><span class="src-sym">}</span>&lt;|!<span class="src-id">REG3XP</span><span class="src-var">$key</span>!&gt;{<span class="src-var">$regexp</span><span class="src-sym">[</span><span class="src-id">GESHI_REPLACE</span><span class="src-sym">]</span><span class="src-sym">}</span>|&gt;{<span class="src-var">$regexp</span><span class="src-sym">[</span><span class="src-id">GESHI_AFTER</span><span class="src-sym">]</span><span class="src-sym">}</span></span>&quot;<span class="src-sym">,</span><a name="a1946"></a><br />1946                          <span class="src-var">$stuff_to_parse</span><a name="a1947"></a><br />1947                      <span class="src-sym">)</span>;<a name="a1948"></a><br />1948                  <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1949"></a><br />1949                      <span class="src-var">$stuff_to_parse</span> = <a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span> <span class="src-str">&quot;#(&quot;</span> . <span class="src-var">$regexp</span> . <span class="src-str">&quot;)#&quot;</span><span class="src-sym">,</span> &quot;<span class="src-str">&lt;|!<span class="src-id">REG3XP</span><span class="src-var">$key</span>!&gt;\\1|&gt;</span>&quot;<span class="src-sym">,</span> <span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span>;<a name="a1950"></a><br />1950                  <span class="src-sym">}</span><a name="a1951"></a><br />1951              <span class="src-sym">}</span><a name="a1952"></a><br />1952          <span class="src-sym">}</span><a name="a1953"></a><br />1953  <a name="a1954"></a><br />1954          <span class="src-comm">//</span><a name="a1955"></a><br />1955          <span class="src-comm">// Highlight numbers. This regexp sucks... anyone with a regexp that WORKS</span><a name="a1956"></a><br />1956          <span class="src-comm">// here wins a cookie if they send it to me. At the moment there's two doing</span><a name="a1957"></a><br />1957          <span class="src-comm">// almost exactly the same thing, except the second one prevents a number</span><a name="a1958"></a><br />1958          <span class="src-comm">// being highlighted twice (eg &lt;span...&gt;&lt;span...&gt;5&lt;/span&gt;&lt;/span&gt;)</span><a name="a1959"></a><br />1959          <span class="src-comm">// Put /NUM!/ in for the styles, which gets replaced at the end.</span><a name="a1960"></a><br />1960          <span class="src-comm">//</span><a name="a1961"></a><br />1961          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span> &amp;&amp; <a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'#[0-9]#'</span><span class="src-sym">,</span> <span class="src-var">$stuff_to_parse</span> <span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1962"></a><br />1962              <span class="src-var">$stuff_to_parse</span> = <a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span><span class="src-str">'#([^a-zA-Z0-9\#])([0-9]+)([^a-zA-Z0-9])#'</span><span class="src-sym">,</span> <span class="src-str">&quot;\\1&lt;|/NUM!/&gt;\\2|&gt;\\3&quot;</span><span class="src-sym">,</span> <span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span>;<a name="a1963"></a><br />1963              <span class="src-var">$stuff_to_parse</span> = <a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span><span class="src-str">'#([^a-zA-Z0-9\#&gt;])([0-9]+)([^a-zA-Z0-9])#'</span><span class="src-sym">,</span> <span class="src-str">&quot;\\1&lt;|/NUM!/&gt;\\2|&gt;\\3&quot;</span><span class="src-sym">,</span> <span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span>;<a name="a1964"></a><br />1964          <span class="src-sym">}</span><a name="a1965"></a><br />1965  <a name="a1966"></a><br />1966          <span class="src-comm">// Highlight keywords</span><a name="a1967"></a><br />1967          <span class="src-comm">// if there is a couple of alpha symbols there *might* be a keyword</span><a name="a1968"></a><br />1968          <span class="src-key">if</span> <span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'#[a-zA-Z]{2,}#'</span><span class="src-sym">,</span> <span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1969"></a><br />1969              <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$k</span> =&gt; <span class="src-var">$keywordset</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1970"></a><br />1970                  <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1971"></a><br />1971                      <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$keywordset</span> <span class="src-key">as</span> <span class="src-var">$keyword</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1972"></a><br />1972                          <span class="src-var">$keyword</span> = <a href="http://www.php.net/quotemeta">quotemeta</a><span class="src-sym">(</span><span class="src-var">$keyword</span><span class="src-sym">)</span>;<a name="a1973"></a><br />1973                          <span class="src-comm">//</span><a name="a1974"></a><br />1974                          <span class="src-comm">// This replacement checks the word is on it's own (except if brackets etc</span><a name="a1975"></a><br />1975                          <span class="src-comm">// are next to it), then highlights it. We don't put the color=&quot; for the span</span><a name="a1976"></a><br />1976                          <span class="src-comm">// in just yet - otherwise languages with the keywords &quot;color&quot; or &quot;or&quot; have</span><a name="a1977"></a><br />1977                          <span class="src-comm">// a fit.</span><a name="a1978"></a><br />1978                          <span class="src-comm">//</span><a name="a1979"></a><br />1979                          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-id">false</span> !== <a href="http://www.php.net/stristr">stristr</a><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">,</span> <span class="src-var">$keyword</span> <span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1980"></a><br />1980                              <span class="src-var">$stuff_to_parse</span> .= <span class="src-str">' '</span>;<a name="a1981"></a><br />1981                              <span class="src-comm">// Might make a more unique string for putting the number in soon</span><a name="a1982"></a><br />1982                              <span class="src-comm">// Basically, we don't put the styles in yet because then the styles themselves will</span><a name="a1983"></a><br />1983                              <span class="src-comm">// get highlighted if the language has a CSS keyword in it (like CSS, for example ;))</span><a name="a1984"></a><br />1984                              <span class="src-var">$styles</span> = &quot;<span class="src-str">/<span class="src-var">$k</span>/</span>&quot;;<a name="a1985"></a><br />1985                              <span class="src-var">$keyword</span> = <a href="http://www.php.net/quotemeta">quotemeta</a><span class="src-sym">(</span><span class="src-var">$keyword</span><span class="src-sym">)</span>;<a name="a1986"></a><br />1986                              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CASE_SENSITIVE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a1987"></a><br />1987                                  <span class="src-var">$stuff_to_parse</span> = <a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span><a name="a1988"></a><br />1988                                      &quot;<span class="src-str">#(<span class="src-sym">[</span>^<span class="src-id">a</span>-<span class="src-id">zA</span>-<span class="src-id">Z0</span>-9\$<span class="src-id">_</span>\|\#;&gt;<span class="src-sym">]</span>)(<span class="src-var">$keyword</span>)(<span class="src-sym">[</span>^<span class="src-id">a</span>-<span class="src-id">zA</span>-<span class="src-id">Z0</span>-9<span class="src-id">_</span>&lt;\|%\-&amp;<span class="src-sym">]</span>)#<span class="src-id">e</span></span>&quot;<span class="src-sym">,</span><a name="a1989"></a><br />1989                                      &quot;<span class="src-str">'\\1' . <span class="src-var">$func2</span>('\\2', '<span class="src-var">$k</span>', '<span class="src-id">BEGIN</span>') . '&lt;|<span class="src-var">$styles</span>&gt;' . <span class="src-var">$func</span>('\\2') . '|&gt;' . <span class="src-var">$func2</span>('\\2', '<span class="src-var">$k</span>', '<span class="src-id">END</span>') . '\\3'</span>&quot;<span class="src-sym">,</span><a name="a1990"></a><br />1990                                      <span class="src-var">$stuff_to_parse</span><a name="a1991"></a><br />1991                                  <span class="src-sym">)</span>;<a name="a1992"></a><br />1992                              <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a1993"></a><br />1993                                  <span class="src-comm">// Change the case of the word.</span><a name="a1994"></a><br />1994                                  <span class="src-var">$stuff_to_parse</span> = <a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span><a name="a1995"></a><br />1995                                      &quot;<span class="src-str">#(<span class="src-sym">[</span>^<span class="src-id">a</span>-<span class="src-id">zA</span>-<span class="src-id">Z0</span>-9\$<span class="src-id">_</span>\|\#;&gt;<span class="src-sym">]</span>)(<span class="src-var">$keyword</span>)(<span class="src-sym">[</span>^<span class="src-id">a</span>-<span class="src-id">zA</span>-<span class="src-id">Z0</span>-9<span class="src-id">_</span>&lt;\|%\-&amp;<span class="src-sym">]</span>)#<span class="src-id">ie</span></span>&quot;<span class="src-sym">,</span><a name="a1996"></a><br />1996                                      &quot;<span class="src-str">'\\1' . <span class="src-var">$func2</span>('\\2', '<span class="src-var">$k</span>', '<span class="src-id">BEGIN</span>') . '&lt;|<span class="src-var">$styles</span>&gt;' . <span class="src-var">$func</span>('\\2') . '|&gt;' . <span class="src-var">$func2</span>('\\2', '<span class="src-var">$k</span>', '<span class="src-id">END</span>') . '\\3'</span>&quot;<span class="src-sym">,</span><a name="a1997"></a><br />1997                                      <span class="src-var">$stuff_to_parse</span><a name="a1998"></a><br />1998                                  <span class="src-sym">)</span>;<a name="a1999"></a><br />1999                              <span class="src-sym">}</span><a name="a2000"></a><br />2000                              <span class="src-var">$stuff_to_parse</span> = <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">,</span> <span class="src-num">0</span><span class="src-sym">,</span> <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span> - <span class="src-num">1</span><span class="src-sym">)</span>;<a name="a2001"></a><br />2001                          <span class="src-sym">}</span><a name="a2002"></a><br />2002                      <span class="src-sym">}</span><a name="a2003"></a><br />2003                  <span class="src-sym">}</span><a name="a2004"></a><br />2004              <span class="src-sym">}</span><a name="a2005"></a><br />2005          <span class="src-sym">}</span><a name="a2006"></a><br />2006  <a name="a2007"></a><br />2007          <span class="src-comm">//</span><a name="a2008"></a><br />2008          <span class="src-comm">// Now that's all done, replace /[number]/ with the correct styles</span><a name="a2009"></a><br />2009          <span class="src-comm">//</span><a name="a2010"></a><br />2010          <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$k</span> =&gt; <span class="src-var">$kws</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2011"></a><br />2011              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2012"></a><br />2012                  <span class="src-var">$attributes</span> = <span class="src-str">' style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span> . <span class="src-str">'&quot;'</span>;<a name="a2013"></a><br />2013              <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a2014"></a><br />2014                  <span class="src-var">$attributes</span> = <span class="src-str">' class=&quot;kw'</span> . <span class="src-var">$k</span> . <span class="src-str">'&quot;'</span>;<a name="a2015"></a><br />2015              <span class="src-sym">}</span><a name="a2016"></a><br />2016              <span class="src-var">$stuff_to_parse</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span>&quot;<span class="src-str">/<span class="src-var">$k</span>/</span>&quot;<span class="src-sym">,</span> <span class="src-var">$attributes</span><span class="src-sym">,</span> <span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span>;<a name="a2017"></a><br />2017          <span class="src-sym">}</span><a name="a2018"></a><br />2018  <a name="a2019"></a><br />2019          <span class="src-comm">// Put number styles in</span><a name="a2020"></a><br />2020          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span> &amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2021"></a><br />2021              <span class="src-var">$attributes</span> = <span class="src-str">' style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> . <span class="src-str">'&quot;'</span>;<a name="a2022"></a><br />2022          <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a2023"></a><br />2023              <span class="src-var">$attributes</span> = <span class="src-str">' class=&quot;nu0&quot;'</span>;<a name="a2024"></a><br />2024          <span class="src-sym">}</span><a name="a2025"></a><br />2025          <span class="src-var">$stuff_to_parse</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'/NUM!/'</span><span class="src-sym">,</span> <span class="src-var">$attributes</span><span class="src-sym">,</span> <span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span>;<a name="a2026"></a><br />2026  <a name="a2027"></a><br />2027          <span class="src-comm">//</span><a name="a2028"></a><br />2028          <span class="src-comm">// Highlight methods and fields in objects</span><a name="a2029"></a><br />2029          <span class="src-comm">//</span><a name="a2030"></a><br />2030          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'METHODS'</span><span class="src-sym">]</span> &amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'OOLANG'</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2031"></a><br />2031              <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'OBJECT_SPLITTERS'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$key</span> =&gt; <span class="src-var">$splitter</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2032"></a><br />2032                  <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-id">false</span> !== <a href="http://www.php.net/stristr">stristr</a><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">,</span> <span class="src-var">$splitter</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2033"></a><br />2033                      <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2034"></a><br />2034                          <span class="src-var">$attributes</span> = <span class="src-str">' style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'METHODS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> . <span class="src-str">'&quot;'</span>;<a name="a2035"></a><br />2035                      <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a2036"></a><br />2036                          <span class="src-var">$attributes</span> = <span class="src-str">' class=&quot;me'</span> . <span class="src-var">$key</span> . <span class="src-str">'&quot;'</span>;<a name="a2037"></a><br />2037                      <span class="src-sym">}</span><a name="a2038"></a><br />2038                      <span class="src-var">$stuff_to_parse</span> = <a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span><span class="src-str">&quot;#(&quot;</span> . <a href="http://www.php.net/quotemeta">quotemeta</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'OBJECT_SPLITTERS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span> . <span class="src-str">&quot;[\s]*)([a-zA-Z\*\(][a-zA-Z0-9_\*]*)#&quot;</span><span class="src-sym">,</span> &quot;<span class="src-str">\\1&lt;|<span class="src-var">$attributes</span>&gt;\\2|&gt;</span>&quot;<span class="src-sym">,</span> <span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span>;<a name="a2039"></a><br />2039                  <span class="src-sym">}</span><a name="a2040"></a><br />2040              <span class="src-sym">}</span><a name="a2041"></a><br />2041          <span class="src-sym">}</span><a name="a2042"></a><br />2042  <a name="a2043"></a><br />2043          <span class="src-comm">//</span><a name="a2044"></a><br />2044          <span class="src-comm">// Highlight brackets. Yes, I've tried adding a semi-colon to this list.</span><a name="a2045"></a><br />2045          <span class="src-comm">// You try it, and see what happens ;)</span><a name="a2046"></a><br />2046          <span class="src-comm">// TODO: Fix lexic permissions not converting entities if shouldn't</span><a name="a2047"></a><br />2047          <span class="src-comm">// be highlighting regardless</span><a name="a2048"></a><br />2048          <span class="src-comm">//</span><a name="a2049"></a><br />2049          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2050"></a><br />2050              <span class="src-var">$code_entities_match</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'['</span><span class="src-sym">,</span> <span class="src-str">']'</span><span class="src-sym">,</span> <span class="src-str">'('</span><span class="src-sym">,</span> <span class="src-str">')'</span><span class="src-sym">,</span> <span class="src-str">'{'</span><span class="src-sym">,</span> <span class="src-str">'}'</span><span class="src-sym">)</span>;<a name="a2051"></a><br />2051              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2052"></a><br />2052                  <span class="src-var">$code_entities_replace</span> = <span class="src-key">array</span><span class="src-sym">(</span><a name="a2053"></a><br />2053                      <span class="src-str">'&lt;| style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> . <span class="src-str">'&quot;&gt;&amp;#91;|&gt;'</span><span class="src-sym">,</span><a name="a2054"></a><br />2054                      <span class="src-str">'&lt;| style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> . <span class="src-str">'&quot;&gt;&amp;#93;|&gt;'</span><span class="src-sym">,</span><a name="a2055"></a><br />2055                      <span class="src-str">'&lt;| style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> . <span class="src-str">'&quot;&gt;&amp;#40;|&gt;'</span><span class="src-sym">,</span><a name="a2056"></a><br />2056                      <span class="src-str">'&lt;| style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> . <span class="src-str">'&quot;&gt;&amp;#41;|&gt;'</span><span class="src-sym">,</span><a name="a2057"></a><br />2057                      <span class="src-str">'&lt;| style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> . <span class="src-str">'&quot;&gt;&amp;#123;|&gt;'</span><span class="src-sym">,</span><a name="a2058"></a><br />2058                      <span class="src-str">'&lt;| style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> . <span class="src-str">'&quot;&gt;&amp;#125;|&gt;'</span><span class="src-sym">,</span><a name="a2059"></a><br />2059                  <span class="src-sym">)</span>;<a name="a2060"></a><br />2060              <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a2061"></a><br />2061                  <span class="src-var">$code_entities_replace</span> = <span class="src-key">array</span><span class="src-sym">(</span><a name="a2062"></a><br />2062                      <span class="src-str">'&lt;| class=&quot;br0&quot;&gt;&amp;#91;|&gt;'</span><span class="src-sym">,</span><a name="a2063"></a><br />2063                      <span class="src-str">'&lt;| class=&quot;br0&quot;&gt;&amp;#93;|&gt;'</span><span class="src-sym">,</span><a name="a2064"></a><br />2064                      <span class="src-str">'&lt;| class=&quot;br0&quot;&gt;&amp;#40;|&gt;'</span><span class="src-sym">,</span><a name="a2065"></a><br />2065                      <span class="src-str">'&lt;| class=&quot;br0&quot;&gt;&amp;#41;|&gt;'</span><span class="src-sym">,</span><a name="a2066"></a><br />2066                      <span class="src-str">'&lt;| class=&quot;br0&quot;&gt;&amp;#123;|&gt;'</span><span class="src-sym">,</span><a name="a2067"></a><br />2067                      <span class="src-str">'&lt;| class=&quot;br0&quot;&gt;&amp;#125;|&gt;'</span><span class="src-sym">,</span><a name="a2068"></a><br />2068                  <span class="src-sym">)</span>;<a name="a2069"></a><br />2069              <span class="src-sym">}</span><a name="a2070"></a><br />2070              <span class="src-var">$stuff_to_parse</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span> <span class="src-var">$code_entities_match</span><span class="src-sym">,</span>  <span class="src-var">$code_entities_replace</span><span class="src-sym">,</span> <span class="src-var">$stuff_to_parse</span> <span class="src-sym">)</span>;<a name="a2071"></a><br />2071          <span class="src-sym">}</span><a name="a2072"></a><br />2072  <a name="a2073"></a><br />2073          <span class="src-comm">//</span><a name="a2074"></a><br />2074          <span class="src-comm">// Add class/style for regexps</span><a name="a2075"></a><br />2075          <span class="src-comm">//</span><a name="a2076"></a><br />2076          <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$key</span> =&gt; <span class="src-var">$regexp</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2077"></a><br />2077              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2078"></a><br />2078                  <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2079"></a><br />2079                      <span class="src-var">$attributes</span> = <span class="src-str">' style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> . <span class="src-str">'&quot;'</span>;<a name="a2080"></a><br />2080                  <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a2081"></a><br />2081                      <span class="src-var">$attributes</span> = <span class="src-str">' class=&quot;re'</span> . <span class="src-var">$key</span> . <span class="src-str">'&quot;'</span>;<a name="a2082"></a><br />2082                  <span class="src-sym">}</span><a name="a2083"></a><br />2083                  <span class="src-var">$stuff_to_parse</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span>&quot;<span class="src-str">!<span class="src-id">REG3XP</span><span class="src-var">$key</span>!</span>&quot;<span class="src-sym">,</span> &quot;<span class="src-str"><span class="src-var">$attributes</span></span>&quot;<span class="src-sym">,</span> <span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span>;<a name="a2084"></a><br />2084              <span class="src-sym">}</span><a name="a2085"></a><br />2085          <span class="src-sym">}</span><a name="a2086"></a><br />2086  <a name="a2087"></a><br />2087          <span class="src-comm">// Replace &lt;DOT&gt; with . for urls</span><a name="a2088"></a><br />2088          <span class="src-var">$stuff_to_parse</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&lt;DOT&gt;'</span><span class="src-sym">,</span> <span class="src-str">'.'</span><span class="src-sym">,</span> <span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span>;<a name="a2089"></a><br />2089          <span class="src-comm">// Replace &lt;|UR1| with &lt;a href= for urls also</span><a name="a2090"></a><br />2090          <span class="src-key">if</span> <span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">link_styles</span><span class="src-sym">[</span><span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_LINK">GESHI_LINK</a></span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2091"></a><br />2091              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2092"></a><br />2092                  <span class="src-var">$stuff_to_parse</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&lt;|UR1|'</span><span class="src-sym">,</span> <span class="src-str">'&lt;a'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">link_target</span> . <span class="src-str">' href='</span><span class="src-sym">,</span> <span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span>;<a name="a2093"></a><br />2093              <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a2094"></a><br />2094                  <span class="src-var">$stuff_to_parse</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&lt;|UR1|'</span><span class="src-sym">,</span> <span class="src-str">'&lt;a'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">link_target</span> . <span class="src-str">' style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">link_styles</span><span class="src-sym">[</span><span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_LINK">GESHI_LINK</a></span><span class="src-sym">]</span> . <span class="src-str">'&quot; href='</span><span class="src-sym">,</span> <span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span>;<a name="a2095"></a><br />2095              <span class="src-sym">}</span><a name="a2096"></a><br />2096          <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a2097"></a><br />2097              <span class="src-var">$stuff_to_parse</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&lt;|UR1|'</span><span class="src-sym">,</span> <span class="src-str">'&lt;a'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">link_target</span> . <span class="src-str">' href='</span><span class="src-sym">,</span> <span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span>;<a name="a2098"></a><br />2098          <span class="src-sym">}</span><a name="a2099"></a><br />2099  <a name="a2100"></a><br />2100          <span class="src-comm">//</span><a name="a2101"></a><br />2101          <span class="src-comm">// NOW we add the span thingy ;)</span><a name="a2102"></a><br />2102          <span class="src-comm">//</span><a name="a2103"></a><br />2103  <a name="a2104"></a><br />2104          <span class="src-var">$stuff_to_parse</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&lt;|'</span><span class="src-sym">,</span> <span class="src-str">'&lt;span'</span><span class="src-sym">,</span> <span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span>;<a name="a2105"></a><br />2105          <span class="src-var">$stuff_to_parse</span> = <a href="http://www.php.net/str_replace">str_replace</a> <span class="src-sym">(</span> <span class="src-str">'|&gt;'</span><span class="src-sym">,</span> <span class="src-str">'&lt;/span&gt;'</span><span class="src-sym">,</span> <span class="src-var">$stuff_to_parse</span> <span class="src-sym">)</span>;<a name="a2106"></a><br />2106  <a name="a2107"></a><br />2107          <span class="src-key">return</span> <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/stripslashes">stripslashes</a><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-num">1</span><span class="src-sym">)</span>;<a name="a2108"></a><br />2108      <span class="src-sym">}</span><a name="a2109"></a><br />2109  <a name="a2110"></a><br />2110      <span class="src-doc">/**</span><a name="a2111"></a><br />2111  <span class="src-doc">	 * Sets the time taken to parse the code</span><a name="a2112"></a><br />2112  <span class="src-doc">     * </span><a name="a2113"></a><br />2113  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">microtime </span><span class="src-doc"></span><span class="src-doc">The time when parsing started</span><a name="a2114"></a><br />2114  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">microtime </span><span class="src-doc"></span><span class="src-doc">The time when parsing ended</span><a name="a2115"></a><br />2115  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc"> 1.0.2</span><a name="a2116"></a><br />2116  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a2117"></a><br />2117  <span class="src-doc">	 */</span><a name="a2118"></a><br />2118      <span class="src-key">function</span> <span class="src-id">set_time</span> <span class="src-sym">(</span><span class="src-var">$start_time</span><span class="src-sym">,</span> <span class="src-var">$end_time</span><span class="src-sym">)</span><a name="a2119"></a><br />2119      <span class="src-sym">{</span><a name="a2120"></a><br />2120          <span class="src-var">$start</span> = <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">' '</span><span class="src-sym">,</span> <span class="src-var">$start_time</span><span class="src-sym">)</span>;<a name="a2121"></a><br />2121          <span class="src-var">$end</span> = <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">' '</span><span class="src-sym">,</span> <span class="src-var">$end_time</span><span class="src-sym">)</span>;<a name="a2122"></a><br />2122          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">time</span> = <span class="src-var">$end</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> + <span class="src-var">$end</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span> - <span class="src-var">$start</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span> - <span class="src-var">$start</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span>;<a name="a2123"></a><br />2123      <span class="src-sym">}</span><a name="a2124"></a><br />2124  <a name="a2125"></a><br />2125      <span class="src-doc">/**</span><a name="a2126"></a><br />2126  <span class="src-doc">	 * Gets the time taken to parse the code</span><a name="a2127"></a><br />2127  <span class="src-doc">     * </span><a name="a2128"></a><br />2128  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@return </span><span class="src-doc"></span><span class="src-doc-type">double </span><span class="src-doc"></span><span class="src-doc">The time taken to parse the code</span><a name="a2129"></a><br />2129  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc">  1.0.2</span><a name="a2130"></a><br />2130  <span class="src-doc">	 */</span><a name="a2131"></a><br />2131      <span class="src-key">function</span> <a href="../core/GeSHi.html#methodget_time">get_time</a> <span class="src-sym">(</span><span class="src-sym">)</span><a name="a2132"></a><br />2132      <span class="src-sym">{</span><a name="a2133"></a><br />2133          <span class="src-key">return</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">time</span>;<a name="a2134"></a><br />2134      <span class="src-sym">}</span><a name="a2135"></a><br />2135  <a name="a2136"></a><br />2136      <span class="src-doc">/**</span><a name="a2137"></a><br />2137  <span class="src-doc">	 * Gets language information and stores it for later use</span><a name="a2138"></a><br />2138  <span class="src-doc">     * </span><a name="a2139"></a><br />2139  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a2140"></a><br />2140  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@todo</span><span class="src-doc"> Needs to load keys for lexic permissions for keywords, regexps etc</span><a name="a2141"></a><br />2141  <span class="src-doc">	 */</span><a name="a2142"></a><br />2142      <span class="src-key">function</span> <span class="src-id">load_language</span> <span class="src-sym">(</span><span class="src-var">$file_name</span><span class="src-sym">)</span><a name="a2143"></a><br />2143      <span class="src-sym">{</span><a name="a2144"></a><br />2144          <span class="src-var">$language_data</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a2145"></a><br />2145          require <span class="src-var">$file_name</span>;<a name="a2146"></a><br />2146          <span class="src-comm">// Perhaps some checking might be added here later to check that</span><a name="a2147"></a><br />2147          <span class="src-comm">// $language data is a valid thing but maybe not</span><a name="a2148"></a><br />2148          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span> = <span class="src-var">$language_data</span>;<a name="a2149"></a><br />2149          <span class="src-comm">// Set strict mode if should be set</span><a name="a2150"></a><br />2150          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STRICT_MODE_APPLIES'</span><span class="src-sym">]</span> == <span class="src-id">GESHI_ALWAYS</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2151"></a><br />2151              <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">strict_mode</span> = <span class="src-id">true</span>;<a name="a2152"></a><br />2152          <span class="src-sym">}</span><a name="a2153"></a><br />2153          <span class="src-comm">// Set permissions for all lexics to true</span><a name="a2154"></a><br />2154          <span class="src-comm">// so they'll be highlighted by default</span><a name="a2155"></a><br />2155          <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$key</span> =&gt; <span class="src-var">$words</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2156"></a><br />2156              <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-id">true</span>;<a name="a2157"></a><br />2157          <span class="src-sym">}</span><a name="a2158"></a><br />2158          <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'COMMENT_SINGLE'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$key</span> =&gt; <span class="src-var">$comment</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2159"></a><br />2159              <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-id">true</span>;<a name="a2160"></a><br />2160          <span class="src-sym">}</span><a name="a2161"></a><br />2161          <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$key</span> =&gt; <span class="src-var">$regexp</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2162"></a><br />2162              <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span> = <span class="src-id">true</span>;<a name="a2163"></a><br />2163          <span class="src-sym">}</span><a name="a2164"></a><br />2164          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../core/GeSHi.html#methodenable_highlighting">enable_highlighting</a><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a2165"></a><br />2165          <span class="src-comm">// Set default class for CSS</span><a name="a2166"></a><br />2166          <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">overall_class</span> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language</span>;<a name="a2167"></a><br />2167      <span class="src-sym">}</span><a name="a2168"></a><br />2168  <a name="a2169"></a><br />2169      <span class="src-doc">/**</span><a name="a2170"></a><br />2170  <span class="src-doc">	 * Takes the parsed code and various options, and creates the HTML</span><a name="a2171"></a><br />2171  <span class="src-doc">	 * surrounding it to make it look nice.</span><a name="a2172"></a><br />2172  <span class="src-doc">     * </span><a name="a2173"></a><br />2173  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"> </span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The code already parsed</span><a name="a2174"></a><br />2174  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@return </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc">The code nicely finalised</span><a name="a2175"></a><br />2175  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@since</span><span class="src-doc">  1.0.0</span><a name="a2176"></a><br />2176  <span class="src-doc">     *</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a2177"></a><br />2177  <span class="src-doc">	 */</span><a name="a2178"></a><br />2178      <span class="src-key">function</span> <span class="src-id">finalise</span> <span class="src-sym">(</span><span class="src-var">$parsed_code</span><span class="src-sym">)</span><a name="a2179"></a><br />2179      <span class="src-sym">{</span><a name="a2180"></a><br />2180          <span class="src-comm">// Remove end parts of important declarations</span><a name="a2181"></a><br />2181          <span class="src-comm">// This is BUGGY!! My fault for bad code: fix coming in 1.2</span><a name="a2182"></a><br />2182          <span class="src-comm">// @todo Remove this crap</span><a name="a2183"></a><br />2183          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">enable_important_blocks</span> &amp;&amp;<a name="a2184"></a><br />2184              <span class="src-sym">(</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><span class="src-var">$parsed_code</span><span class="src-sym">,</span> <span class="src-sym">@</span><a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_START_IMPORTANT">GESHI_START_IMPORTANT</a></span><span class="src-sym">,</span> <span class="src-id">ENT_COMPAT</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span><span class="src-sym">)</span><span class="src-sym">)</span> === <span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2185"></a><br />2185              <span class="src-var">$parsed_code</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-sym">@</span><a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_END_IMPORTANT">GESHI_END_IMPORTANT</a></span><span class="src-sym">,</span> <span class="src-id">ENT_COMPAT</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-str">''</span><span class="src-sym">,</span> <span class="src-var">$parsed_code</span><span class="src-sym">)</span>;<a name="a2186"></a><br />2186          <span class="src-sym">}</span><a name="a2187"></a><br />2187          <a name="a2188"></a><br />2188          <span class="src-comm">// Add HTML whitespace stuff if we're using the &lt;div&gt; header</span><a name="a2189"></a><br />2189          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">header_type</span> != <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_HEADER_PRE">GESHI_HEADER_PRE</a></span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2190"></a><br />2190              <span class="src-var">$parsed_code</span> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">indent</span><span class="src-sym">(</span><span class="src-var">$parsed_code</span><span class="src-sym">)</span>;<a name="a2191"></a><br />2191          <span class="src-sym">}</span><a name="a2192"></a><br />2192          <a name="a2193"></a><br />2193          <span class="src-comm">// If we're using line numbers, we insert &lt;li&gt;s and appropriate</span><a name="a2194"></a><br />2194          <span class="src-comm">// markup to style them (otherwise we don't need to do anything)</span><a name="a2195"></a><br />2195          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_numbers</span> != <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_NO_LINE_NUMBERS">GESHI_NO_LINE_NUMBERS</a></span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2196"></a><br />2196              <span class="src-comm">// If we're using the &lt;pre&gt; header, we shouldn't add newlines because</span><a name="a2197"></a><br />2197              <span class="src-comm">// the &lt;pre&gt; will line-break them (and the &lt;li&gt;s already do this for us)</span><a name="a2198"></a><br />2198              <span class="src-var">$ls</span> = <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">header_type</span> != <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_HEADER_PRE">GESHI_HEADER_PRE</a></span><span class="src-sym">)</span> ? <span class="src-str">&quot;\n&quot;</span> : <span class="src-str">''</span>;<a name="a2199"></a><br />2199              <span class="src-comm">// Get code into lines</span><a name="a2200"></a><br />2200              <span class="src-var">$code</span> = <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span> <span class="src-var">$parsed_code</span><span class="src-sym">)</span>;<a name="a2201"></a><br />2201              <span class="src-comm">// Set vars to defaults for following loop</span><a name="a2202"></a><br />2202              <span class="src-var">$parsed_code</span> = <span class="src-str">''</span>;<a name="a2203"></a><br />2203              <span class="src-var">$i</span> = <span class="src-num">0</span>;<a name="a2204"></a><br />2204              <span class="src-comm">// Foreach line...</span><a name="a2205"></a><br />2205              <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$code</span> <span class="src-key">as</span> <span class="src-var">$line</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2206"></a><br />2206                  <span class="src-var">$line</span> = <span class="src-sym">(</span> <span class="src-var">$line</span> <span class="src-sym">)</span> ? <span class="src-var">$line</span> : <span class="src-str">'&amp;nbsp;'</span>;<a name="a2207"></a><br />2207                  <span class="src-comm">// If this is a &quot;special line&quot;...</span><a name="a2208"></a><br />2208                  <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_numbers</span> == <span class="src-id"><a href="../core/_geshi_php.html#defineGESHI_FANCY_LINE_NUMBERS">GESHI_FANCY_LINE_NUMBERS</a></span> &amp;&amp;<a name="a2209"></a><br />2209                      <span class="src-var">$i</span> % <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_nth_row</span> == <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_nth_row</span> - <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2210"></a><br />2210                      <span class="src-comm">// Set the attributes to style the line</span><a name="a2211"></a><br />2211                      <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2212"></a><br />2212                          <span class="src-var">$attr</span> = <span class="src-str">' class=&quot;li2&quot;'</span>;<a name="a2213"></a><br />2213                          <span class="src-var">$def_attr</span> = <span class="src-str">' class=&quot;de2&quot;'</span>;<a name="a2214"></a><br />2214                      <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a2215"></a><br />2215                          <span class="src-var">$attr</span> = <span class="src-str">' style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_style2</span> . <span class="src-str">'&quot;'</span>;<a name="a2216"></a><br />2216                          <span class="src-comm">// This style &quot;covers up&quot; the special styles set for special lines</span><a name="a2217"></a><br />2217                          <span class="src-comm">// so that styles applied to special lines don't apply to the actual</span><a name="a2218"></a><br />2218                          <span class="src-comm">// code on that line</span><a name="a2219"></a><br />2219                          <span class="src-var">$def_attr</span> = <span class="src-str">' style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">code_style</span> . <span class="src-str">'&quot;'</span>;<a name="a2220"></a><br />2220                      <span class="src-sym">}</span><a name="a2221"></a><br />2221                      <span class="src-comm">// Span or div?</span><a name="a2222"></a><br />2222                      <span class="src-var">$start</span> = &quot;<span class="src-str">&lt;<span class="src-id">div</span><span class="src-var">$def_attr</span>&gt;</span>&quot;;<a name="a2223"></a><br />2223                      <span class="src-var">$end</span> = <span class="src-str">'&lt;/div&gt;'</span>;<a name="a2224"></a><br />2224                  <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a2225"></a><br />2225                      <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2226"></a><br />2226                          <span class="src-var">$attr</span> = <span class="src-str">' class=&quot;li1&quot;'</span>;<a name="a2227"></a><br />2227                          <span class="src-var">$def_attr</span> = <span class="src-str">' class=&quot;de1&quot;'</span>;<a name="a2228"></a><br />2228                      <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span><a name="a2229"></a><br />2229                          <span class="src-var">$attr</span> = <span class="src-str">' style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_style1</span> . <span class="src-str">'&quot;'</span>;<a name="a2230"></a><br />2230                          <span class="src-var">$def_attr</span> = <span class="src-str">' style=&quot;'</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">code_style</span> . <span class="src-str">'&quot;'</span>;<a name="a2231"></a><br />2231                      <span class="src-sym">}</span><a name="a2232"></a><br />2232                      <span class="src-var">$start</span> = &quot;<span class="src-str">&lt;<span class="src-id">div</span><span class="src-var">$def_attr</span>&gt;</span>&quot;;<a name="a2233"></a><br />2233                      <span class="src-var">$end</span> = <span class="src-str">'&lt;/div&gt;'</span>;<a name="a2234"></a><br />2234                  <span class="src-sym">}</span><a name="a2235"></a><br />2235          <a name="a2236"></a><br />2236                  ++<span class="src-var">$i</span>;<a name="a2237"></a><br />2237                  <span class="src-comm">// Are we supposed to use ids? If so, add them</span><a name="a2238"></a><br />2238                  <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">add_ids</span><span class="src-sym">)</span> <span class="src-sym">{</span><a name="a2239"></a><br />2239                      <span class="src-var">$attr</span> .= &quot;<span class="src-str"> <span class="src-id">id</span>=\&quot;{<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">overall_id</span><span class="src-sym">}</span>-{<span class="src-var">$i</span><span class="src-str"><span class="src-sym">}</span>\&quot;";</span><a name="a2240"></a><br />2240  <span class="src-str">                <span class="src-sym">}</span></span><a name="a2241"></a><br />2241  <span class="src-str">                <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span> &amp;&amp; <span class="src-id">in_array</span><span class="src-sym">(</span><span class="src-var">$i</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2242"></a><br />2242  <span class="src-str">                    <span class="src-var">$attr</span> .= <span class="src-str">&quot; class=\&quot;ln-xtra\&quot;&quot;</span>;</span><a name="a2243"></a><br />2243  <span class="src-str">                <span class="src-sym">}</span></span><a name="a2244"></a><br />2244  <span class="src-str">                <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span> &amp;&amp; <span class="src-id">in_array</span><span class="src-sym">(</span><span class="src-var">$i</span><span class="src-sym">,</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2245"></a><br />2245  <span class="src-str">                    <span class="src-var">$attr</span> .= " <span class="src-id">style</span>=\&quot;</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines_style</span><span class="src-sym">}</span>\&quot;<span class="src-str">";</span><a name="a2246"></a><br />2246  <span class="src-str">                <span class="src-sym">}</span></span><a name="a2247"></a><br />2247  <a name="a2248"></a><br />2248  <span class="src-str">                <span class="src-comm">// Add in the line surrounded by appropriate list HTML</span></span><a name="a2249"></a><br />2249  <span class="src-str">                <span class="src-var">$parsed_code</span> .= "&lt;<span class="src-id">li</span><span class="src-var">$attr</span>&gt;<span class="src-var">$start</span><span class="src-var">$line</span><span class="src-var">$end</span>&lt;/<span class="src-id">li</span>&gt;<span class="src-var">$ls</span>";</span><a name="a2250"></a><br />2250  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2251"></a><br />2251  <span class="src-str">        <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span></span><a name="a2252"></a><br />2252  <span class="src-str">            <span class="src-comm">// No line numbers, but still need to handle highlighting lines extra.</span></span><a name="a2253"></a><br />2253  <span class="src-str">            <span class="src-comm">// Have to use divs so the full width of the code is highlighted</span></span><a name="a2254"></a><br />2254  <span class="src-str">            <span class="src-var">$code</span> = <span class="src-id">explode</span><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span> <span class="src-var">$parsed_code</span><span class="src-sym">)</span>;</span><a name="a2255"></a><br />2255  <span class="src-str">            <span class="src-var">$parsed_code</span> = <span class="src-str">''</span>;</span><a name="a2256"></a><br />2256  <span class="src-str">            <span class="src-var">$i</span> = <span class="src-num">0</span>;</span><a name="a2257"></a><br />2257  <span class="src-str">            <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$code</span> <span class="src-key">as</span> <span class="src-var">$line</span><span class="src-sym">)</span></span><a name="a2258"></a><br />2258  <span class="src-str">            <span class="src-sym">{</span></span><a name="a2259"></a><br />2259  <span class="src-str">                <span class="src-comm">// Make lines have at least one space in them if they're empty</span></span><a name="a2260"></a><br />2260  <span class="src-str">                <span class="src-var">$line</span> = <span class="src-sym">(</span><span class="src-var">$line</span><span class="src-sym">)</span> ? <span class="src-var">$line</span> : <span class="src-str">'&amp;nbsp;'</span>;</span><a name="a2261"></a><br />2261  <span class="src-str">                <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-id">in_array</span><span class="src-sym">(</span>++<span class="src-var">$i</span><span class="src-sym">,</span> <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2262"></a><br />2262  <span class="src-str">                    <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2263"></a><br />2263  <span class="src-str">                        <span class="src-var">$parsed_code</span> .= <span class="src-str">'&lt;div class=&quot;ln-xtra&quot;&gt;'</span>;</span><a name="a2264"></a><br />2264  <span class="src-str">                    <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span></span><a name="a2265"></a><br />2265  <span class="src-str">                        <span class="src-var">$parsed_code</span> .= "&lt;<span class="src-id">div</span> <span class="src-id">style</span>=\&quot;</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines_style</span><span class="src-sym">}</span>\&quot;&gt;<span class="src-str">";</span><a name="a2266"></a><br />2266  <span class="src-str">                    <span class="src-sym">}</span></span><a name="a2267"></a><br />2267  <span class="src-str">                    <span class="src-var">$parsed_code</span> .= <span class="src-var">$line</span> . <span class="src-str">&quot;&lt;/div&gt;\n&quot;</span>;</span><a name="a2268"></a><br />2268  <span class="src-str">                <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span></span><a name="a2269"></a><br />2269  <span class="src-str">                    <span class="src-var">$parsed_code</span> .= <span class="src-var">$line</span> . <span class="src-str">&quot;\n&quot;</span>;</span><a name="a2270"></a><br />2270  <span class="src-str">                <span class="src-sym">}</span></span><a name="a2271"></a><br />2271  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2272"></a><br />2272  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2273"></a><br />2273  <span class="src-str">        </span><a name="a2274"></a><br />2274  <span class="src-str">        <span class="src-comm">// purge some unnecessary stuff</span></span><a name="a2275"></a><br />2275  <span class="src-str">        <span class="src-var">$parsed_code</span> = <span class="src-id">preg_replace</span><span class="src-sym">(</span><span class="src-str">'#&lt;span[^&gt;]+&gt;(\s*)&lt;/span&gt;#'</span><span class="src-sym">,</span> <span class="src-str">'\\1'</span><span class="src-sym">,</span> <span class="src-var">$parsed_code</span><span class="src-sym">)</span>;</span><a name="a2276"></a><br />2276  <span class="src-str">        <span class="src-var">$parsed_code</span> = <span class="src-id">preg_replace</span><span class="src-sym">(</span><span class="src-str">'#&lt;div[^&gt;]+&gt;(\s*)&lt;/div&gt;#'</span><span class="src-sym">,</span> <span class="src-str">'\\1'</span><span class="src-sym">,</span> <span class="src-var">$parsed_code</span><span class="src-sym">)</span>;</span><a name="a2277"></a><br />2277  <span class="src-str">        </span><a name="a2278"></a><br />2278  <span class="src-str">        <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">header_type</span> == <span class="src-id">GESHI_HEADER_PRE</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2279"></a><br />2279  <span class="src-str">            <span class="src-comm">// enforce line numbers when using pre</span></span><a name="a2280"></a><br />2280  <span class="src-str">            <span class="src-var">$parsed_code</span> = <span class="src-id">str_replace</span><span class="src-sym">(</span><span class="src-str">'&lt;li&gt;&lt;/li&gt;'</span><span class="src-sym">,</span> <span class="src-str">'&lt;li&gt;&amp;nbsp;&lt;/li&gt;'</span><span class="src-sym">,</span> <span class="src-var">$parsed_code</span><span class="src-sym">)</span>;</span><a name="a2281"></a><br />2281  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2282"></a><br />2282  <span class="src-str">        </span><a name="a2283"></a><br />2283  <span class="src-str">        <span class="src-key">return</span> <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">header</span><span class="src-sym">(</span><span class="src-sym">)</span> . <span class="src-id">chop</span><span class="src-sym">(</span><span class="src-var">$parsed_code</span><span class="src-sym">)</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">footer</span><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a2284"></a><br />2284      <span class="src-str"><span class="src-sym">}</span></span><a name="a2285"></a><br />2285  <a name="a2286"></a><br />2286  <span class="src-str">    <span class="src-comm">/**</span></span><a name="a2287"></a><br />2287  <span class="src-str"><span class="src-comm">	 * Creates the header for the code block (with correct attributes)</span></span><a name="a2288"></a><br />2288  <span class="src-str"><span class="src-comm">     * </span></span><a name="a2289"></a><br />2289  <span class="src-str"><span class="src-comm">     * @return string The header for the code block</span></span><a name="a2290"></a><br />2290  <span class="src-str"><span class="src-comm">     * @since  1.0.0</span></span><a name="a2291"></a><br />2291  <span class="src-str"><span class="src-comm">     * @access private</span></span><a name="a2292"></a><br />2292  <span class="src-str"><span class="src-comm">	 */</span></span><a name="a2293"></a><br />2293  <span class="src-str">    <span class="src-key">function</span> <span class="src-id">header</span> <span class="src-sym">(</span><span class="src-sym">)</span></span><a name="a2294"></a><br />2294  <span class="src-str">    <span class="src-sym">{</span></span><a name="a2295"></a><br />2295  <span class="src-str">        <span class="src-comm">// Get attributes needed</span></span><a name="a2296"></a><br />2296  <span class="src-str">        <span class="src-var">$attributes</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">get_attributes</span><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a2297"></a><br />2297  <a name="a2298"></a><br />2298          <span class="src-var">$ol_attributes</span> = <span class="src-str">''</span>;<a name="a2299"></a><br />2299  <a name="a2300"></a><br />2300          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_numbers_start</span> != <span class="src-num">1</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2301"></a><br />2301  <span class="src-str">            <span class="src-var">$ol_attributes</span> .= <span class="src-str">' start=&quot;'</span> . <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">line_numbers_start</span> . <span class="src-str">'&quot;'</span>;<a name="a2302"></a><br />2302          <span class="src-str"><span class="src-sym">}</span></span><a name="a2303"></a><br />2303  <a name="a2304"></a><br />2304  <span class="src-str">        <span class="src-comm">// Get the header HTML</span></span><a name="a2305"></a><br />2305  <span class="src-str">        <span class="src-var">$header</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">format_header_content</span><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a2306"></a><br />2306  <a name="a2307"></a><br />2307          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-id">GESHI_HEADER_NONE</span> == <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">header_type</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2308"></a><br />2308  <span class="src-str">            <span class="src-key">return</span> "<span class="src-var">$header</span>&lt;<span class="src-id">ol</span><span class="src-var">$ol_attributes</span>&gt;";</span><a name="a2309"></a><br />2309  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2310"></a><br />2310  <span class="src-str">        </span><a name="a2311"></a><br />2311  <span class="src-str">        <span class="src-comm">// Work out what to return and do it</span></span><a name="a2312"></a><br />2312  <span class="src-str">        <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">line_numbers</span> != <span class="src-id">GESHI_NO_LINE_NUMBERS</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2313"></a><br />2313  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">header_type</span> == <span class="src-id">GESHI_HEADER_PRE</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2314"></a><br />2314  <span class="src-str">                <span class="src-key">return</span> "&lt;<span class="src-id">pre</span><span class="src-var">$attributes</span>&gt;<span class="src-var">$header</span>&lt;<span class="src-id">ol</span><span class="src-var">$ol_attributes</span>&gt;";</span><a name="a2315"></a><br />2315  <span class="src-str">            <span class="src-sym">}</span> <span class="src-key">elseif</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">header_type</span> == <span class="src-id">GESHI_HEADER_DIV</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2316"></a><br />2316  <span class="src-str">                <span class="src-key">return</span> "&lt;<span class="src-id">div</span><span class="src-var">$attributes</span>&gt;<span class="src-var">$header</span>&lt;<span class="src-id">ol</span><span class="src-var">$ol_attributes</span>&gt;";</span><a name="a2317"></a><br />2317  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2318"></a><br />2318  <span class="src-str">        <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span></span><a name="a2319"></a><br />2319  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">header_type</span> == <span class="src-id">GESHI_HEADER_PRE</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2320"></a><br />2320  <span class="src-str">                <span class="src-key">return</span> "&lt;<span class="src-id">pre</span><span class="src-var">$attributes</span>&gt;<span class="src-var">$header</span>";</span><a name="a2321"></a><br />2321  <span class="src-str">            <span class="src-sym">}</span> <span class="src-key">elseif</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">header_type</span> == <span class="src-id">GESHI_HEADER_DIV</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2322"></a><br />2322  <span class="src-str">                <span class="src-key">return</span> "&lt;<span class="src-id">div</span><span class="src-var">$attributes</span>&gt;<span class="src-var">$header</span>";</span><a name="a2323"></a><br />2323  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2324"></a><br />2324  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2325"></a><br />2325  <span class="src-str">    <span class="src-sym">}</span></span><a name="a2326"></a><br />2326  <a name="a2327"></a><br />2327  <span class="src-str">    <span class="src-comm">/**</span></span><a name="a2328"></a><br />2328  <span class="src-str"><span class="src-comm">	 * Returns the header content, formatted for output</span></span><a name="a2329"></a><br />2329  <span class="src-str"><span class="src-comm">     * </span></span><a name="a2330"></a><br />2330  <span class="src-str"><span class="src-comm">     * @return string The header content, formatted for output</span></span><a name="a2331"></a><br />2331  <span class="src-str"><span class="src-comm">     * @since  1.0.2</span></span><a name="a2332"></a><br />2332  <span class="src-str"><span class="src-comm">     * @access private</span></span><a name="a2333"></a><br />2333  <span class="src-str"><span class="src-comm">	 */</span></span><a name="a2334"></a><br />2334  <span class="src-str">    <span class="src-key">function</span> <span class="src-id">format_header_content</span> <span class="src-sym">(</span><span class="src-sym">)</span></span><a name="a2335"></a><br />2335  <span class="src-str">    <span class="src-sym">{</span></span><a name="a2336"></a><br />2336  <span class="src-str">        <span class="src-var">$header</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">header_content</span>;<a name="a2337"></a><br />2337          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$header</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2338"></a><br />2338  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">header_type</span> == <span class="src-id">GESHI_HEADER_PRE</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2339"></a><br />2339  <span class="src-str">                <span class="src-var">$header</span> = <span class="src-id">str_replace</span><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span> <span class="src-str">''</span><span class="src-sym">,</span> <span class="src-var">$header</span><span class="src-sym">)</span>;</span><a name="a2340"></a><br />2340  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2341"></a><br />2341  <span class="src-str">            <span class="src-var">$header</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">replace_keywords</span><span class="src-sym">(</span><span class="src-var">$header</span><span class="src-sym">)</span>;<a name="a2342"></a><br />2342  <a name="a2343"></a><br />2343              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2344"></a><br />2344  <span class="src-str">                <span class="src-var">$attr</span> = <span class="src-str">' class=&quot;head&quot;'</span>;</span><a name="a2345"></a><br />2345  <span class="src-str">            <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span></span><a name="a2346"></a><br />2346  <span class="src-str">                <span class="src-var">$attr</span> = " <span class="src-id">style</span>=\&quot;</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">header_content_style</span><span class="src-sym">}</span>\&quot;<span class="src-str">";</span><a name="a2347"></a><br />2347  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2348"></a><br />2348  <span class="src-str">            <span class="src-key">return</span> "&lt;<span class="src-id">div</span><span class="src-var">$attr</span>&gt;<span class="src-var">$header</span>&lt;/<span class="src-id">div</span>&gt;";</span><a name="a2349"></a><br />2349  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2350"></a><br />2350  <span class="src-str">    <span class="src-sym">}</span></span><a name="a2351"></a><br />2351  <a name="a2352"></a><br />2352  <span class="src-str">    <span class="src-comm">/**</span></span><a name="a2353"></a><br />2353  <span class="src-str"><span class="src-comm">	 * Returns the footer for the code block.</span></span><a name="a2354"></a><br />2354  <span class="src-str"><span class="src-comm">     * </span></span><a name="a2355"></a><br />2355  <span class="src-str"><span class="src-comm">     * @return string The footer for the code block</span></span><a name="a2356"></a><br />2356  <span class="src-str"><span class="src-comm">     * @since  1.0.0</span></span><a name="a2357"></a><br />2357  <span class="src-str"><span class="src-comm">     * @access private</span></span><a name="a2358"></a><br />2358  <span class="src-str"><span class="src-comm">	 */</span></span><a name="a2359"></a><br />2359  <span class="src-str">    <span class="src-key">function</span> <span class="src-id">footer</span> <span class="src-sym">(</span><span class="src-sym">)</span></span><a name="a2360"></a><br />2360  <span class="src-str">    <span class="src-sym">{</span></span><a name="a2361"></a><br />2361  <span class="src-str">        <span class="src-var">$footer_content</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">format_footer_content</span><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a2362"></a><br />2362  <a name="a2363"></a><br />2363          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-id">GESHI_HEADER_NONE</span> == <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">header_type</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2364"></a><br />2364  <span class="src-str">            <span class="src-key">return</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">line_numbers</span> != <span class="src-id">GESHI_NO_LINE_NUMBERS</span><span class="src-sym">)</span> ? <span class="src-str">'&lt;/ol&gt;'</span> . <span class="src-var">$footer_content</span><a name="a2365"></a><br />2365                  : <span class="src-var">$footer_content</span>;<a name="a2366"></a><br />2366          <span class="src-str"><span class="src-sym">}</span></span><a name="a2367"></a><br />2367  <span class="src-str">        </span><a name="a2368"></a><br />2368  <span class="src-str">        <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">header_type</span> == <span class="src-id">GESHI_HEADER_DIV</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2369"></a><br />2369  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">line_numbers</span> != <span class="src-id">GESHI_NO_LINE_NUMBERS</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2370"></a><br />2370  <span class="src-str">                <span class="src-key">return</span> "&lt;/<span class="src-id">ol</span>&gt;<span class="src-var">$footer_content</span>&lt;/<span class="src-id">div</span>&gt;";</span><a name="a2371"></a><br />2371  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2372"></a><br />2372  <span class="src-str">            <span class="src-key">return</span> "<span class="src-var">$footer_content</span>&lt;/<span class="src-id">div</span>&gt;";</span><a name="a2373"></a><br />2373  <span class="src-str">        <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span></span><a name="a2374"></a><br />2374  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">line_numbers</span> != <span class="src-id">GESHI_NO_LINE_NUMBERS</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2375"></a><br />2375  <span class="src-str">                <span class="src-key">return</span> "&lt;/<span class="src-id">ol</span>&gt;<span class="src-var">$footer_content</span>&lt;/<span class="src-id">pre</span>&gt;";</span><a name="a2376"></a><br />2376  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2377"></a><br />2377  <span class="src-str">            <span class="src-key">return</span> "<span class="src-var">$footer_content</span>&lt;/<span class="src-id">pre</span>&gt;";</span><a name="a2378"></a><br />2378  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2379"></a><br />2379  <span class="src-str">    <span class="src-sym">}</span></span><a name="a2380"></a><br />2380  <a name="a2381"></a><br />2381  <span class="src-str">    <span class="src-comm">/**</span></span><a name="a2382"></a><br />2382  <span class="src-str"><span class="src-comm">	 * Returns the footer content, formatted for output</span></span><a name="a2383"></a><br />2383  <span class="src-str"><span class="src-comm">     * </span></span><a name="a2384"></a><br />2384  <span class="src-str"><span class="src-comm">     * @return string The footer content, formatted for output</span></span><a name="a2385"></a><br />2385  <span class="src-str"><span class="src-comm">     * @since  1.0.2</span></span><a name="a2386"></a><br />2386  <span class="src-str"><span class="src-comm">     * @access private</span></span><a name="a2387"></a><br />2387  <span class="src-str"><span class="src-comm">	 */</span></span><a name="a2388"></a><br />2388  <span class="src-str">    <span class="src-key">function</span> <span class="src-id">format_footer_content</span> <span class="src-sym">(</span><span class="src-sym">)</span></span><a name="a2389"></a><br />2389  <span class="src-str">    <span class="src-sym">{</span></span><a name="a2390"></a><br />2390  <span class="src-str">        <span class="src-var">$footer</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">footer_content</span>;<a name="a2391"></a><br />2391          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$footer</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2392"></a><br />2392  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">header_type</span> == <span class="src-id">GESHI_HEADER_PRE</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2393"></a><br />2393  <span class="src-str">                <span class="src-var">$footer</span> = <span class="src-id">str_replace</span><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span> <span class="src-str">''</span><span class="src-sym">,</span> <span class="src-var">$footer</span><span class="src-sym">)</span>;;</span><a name="a2394"></a><br />2394  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2395"></a><br />2395  <span class="src-str">            <span class="src-var">$footer</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">replace_keywords</span><span class="src-sym">(</span><span class="src-var">$footer</span><span class="src-sym">)</span>;<a name="a2396"></a><br />2396  <a name="a2397"></a><br />2397              <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2398"></a><br />2398  <span class="src-str">                <span class="src-var">$attr</span> = <span class="src-str">' class=&quot;foot&quot;'</span>;</span><a name="a2399"></a><br />2399  <span class="src-str">            <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span></span><a name="a2400"></a><br />2400  <span class="src-str">                <span class="src-var">$attr</span> = " <span class="src-id">style</span>=\&quot;</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">footer_content_style</span><span class="src-sym">}</span>\&quot;&gt;<span class="src-str">";</span><a name="a2401"></a><br />2401  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2402"></a><br />2402  <span class="src-str">            <span class="src-key">return</span> "&lt;<span class="src-id">div</span><span class="src-var">$attr</span>&gt;<span class="src-var">$footer</span>&lt;/<span class="src-id">div</span>&gt;";</span><a name="a2403"></a><br />2403  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2404"></a><br />2404  <span class="src-str">    <span class="src-sym">}</span></span><a name="a2405"></a><br />2405  <a name="a2406"></a><br />2406  <span class="src-str">    <span class="src-comm">/**</span></span><a name="a2407"></a><br />2407  <span class="src-str"><span class="src-comm">	 * Replaces certain keywords in the header and footer with</span></span><a name="a2408"></a><br />2408  <span class="src-str"><span class="src-comm">	 * certain configuration values</span></span><a name="a2409"></a><br />2409  <span class="src-str"><span class="src-comm">     * </span></span><a name="a2410"></a><br />2410  <span class="src-str"><span class="src-comm">     * @param  string The header or footer content to do replacement on</span></span><a name="a2411"></a><br />2411  <span class="src-str"><span class="src-comm">     * @return string The header or footer with replaced keywords</span></span><a name="a2412"></a><br />2412  <span class="src-str"><span class="src-comm">     * @since  1.0.2</span></span><a name="a2413"></a><br />2413  <span class="src-str"><span class="src-comm">     * @access private</span></span><a name="a2414"></a><br />2414  <span class="src-str"><span class="src-comm">	 */</span></span><a name="a2415"></a><br />2415  <span class="src-str">    <span class="src-key">function</span> <span class="src-id">replace_keywords</span> <span class="src-sym">(</span><span class="src-var">$instr</span><span class="src-sym">)</span></span><a name="a2416"></a><br />2416  <span class="src-str">    <span class="src-sym">{</span></span><a name="a2417"></a><br />2417  <span class="src-str">        <span class="src-var">$keywords</span> = <span class="src-var">$replacements</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span>;</span><a name="a2418"></a><br />2418  <a name="a2419"></a><br />2419  <span class="src-str">        <span class="src-var">$keywords</span><span class="src-sym">[</span><span class="src-sym">]</span> = <span class="src-str">'&lt;TIME&gt;'</span>;</span><a name="a2420"></a><br />2420  <span class="src-str">        <span class="src-var">$replacements</span><span class="src-sym">[</span><span class="src-sym">]</span> = <span class="src-id">number_format</span><span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../core/GeSHi.html#methodget_time">get_time</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-num">3</span><span class="src-sym">)</span>;<a name="a2421"></a><br />2421  <a name="a2422"></a><br />2422          <span class="src-var">$keywords</span><span class="src-sym">[</span><span class="src-sym">]</span> = <span class="src-str">'&lt;LANGUAGE&gt;'</span>;<a name="a2423"></a><br />2423          <span class="src-var">$replacements</span><span class="src-sym">[</span><span class="src-sym">]</span> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language</span>;<a name="a2424"></a><br />2424  <a name="a2425"></a><br />2425          <span class="src-var">$keywords</span><span class="src-sym">[</span><span class="src-sym">]</span> = <span class="src-str">'&lt;VERSION&gt;'</span>;<a name="a2426"></a><br />2426          <span class="src-var">$replacements</span><span class="src-sym">[</span><span class="src-sym">]</span> = <span class="src-id">GESHI_VERSION</span>;<a name="a2427"></a><br />2427  <a name="a2428"></a><br />2428          <span class="src-key">return</span> <span class="src-id">str_replace</span><span class="src-sym">(</span><span class="src-var">$keywords</span><span class="src-sym">,</span> <span class="src-var">$replacements</span><span class="src-sym">,</span> <span class="src-var">$instr</span><span class="src-sym">)</span>;<a name="a2429"></a><br />2429      <span class="src-str"><span class="src-sym">}</span></span><a name="a2430"></a><br />2430  <a name="a2431"></a><br />2431  <span class="src-str">    <span class="src-comm">/**</span></span><a name="a2432"></a><br />2432  <span class="src-str"><span class="src-comm">	 * Gets the CSS attributes for this code</span></span><a name="a2433"></a><br />2433  <span class="src-str"><span class="src-comm">     * </span></span><a name="a2434"></a><br />2434  <span class="src-str"><span class="src-comm">     * @return The CSS attributes for this code</span></span><a name="a2435"></a><br />2435  <span class="src-str"><span class="src-comm">     * @since  1.0.0</span></span><a name="a2436"></a><br />2436  <span class="src-str"><span class="src-comm">     * @access private</span></span><a name="a2437"></a><br />2437  <span class="src-str"><span class="src-comm">     * @todo   Document behaviour change - class is outputted regardless of whether we're using classes or not.</span></span><a name="a2438"></a><br />2438  <span class="src-str"><span class="src-comm">     *         Same with style</span></span><a name="a2439"></a><br />2439  <span class="src-str"><span class="src-comm">	 */</span></span><a name="a2440"></a><br />2440  <span class="src-str">    <span class="src-key">function</span> <span class="src-id">get_attributes</span> <span class="src-sym">(</span><span class="src-sym">)</span></span><a name="a2441"></a><br />2441  <span class="src-str">    <span class="src-sym">{</span></span><a name="a2442"></a><br />2442  <span class="src-str">        <span class="src-var">$attributes</span> = <span class="src-str">''</span>;</span><a name="a2443"></a><br />2443  <a name="a2444"></a><br />2444  <span class="src-str">        <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">overall_class</span> != <span class="src-str">''</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2445"></a><br />2445  <span class="src-str">            <span class="src-var">$attributes</span> .= " <span class="src-id">class</span>=\&quot;</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">overall_class</span><span class="src-sym">}</span>\&quot;<span class="src-str">";</span><a name="a2446"></a><br />2446  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2447"></a><br />2447  <span class="src-str">        <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">overall_id</span> != <span class="src-str">''</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2448"></a><br />2448  <span class="src-str">            <span class="src-var">$attributes</span> .= " <span class="src-id">id</span>=\&quot;</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">overall_id</span><span class="src-sym">}</span>\&quot;<span class="src-str">";</span><a name="a2449"></a><br />2449  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2450"></a><br />2450  <span class="src-str">        <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">overall_style</span> != <span class="src-str">''</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2451"></a><br />2451  <span class="src-str">            <span class="src-var">$attributes</span> .= <span class="src-str">' style=&quot;'</span> . <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">overall_style</span> . <span class="src-str">'&quot;'</span>;<a name="a2452"></a><br />2452          <span class="src-str"><span class="src-sym">}</span></span><a name="a2453"></a><br />2453  <span class="src-str">        <span class="src-key">return</span> <span class="src-var">$attributes</span>;</span><a name="a2454"></a><br />2454  <span class="src-str">    <span class="src-sym">}</span></span><a name="a2455"></a><br />2455  <a name="a2456"></a><br />2456  <span class="src-str">    <span class="src-comm">/**</span></span><a name="a2457"></a><br />2457  <span class="src-str"><span class="src-comm">	 * Returns a stylesheet for the highlighted code. If $economy mode</span></span><a name="a2458"></a><br />2458  <span class="src-str"><span class="src-comm">	 * is true, we only return the stylesheet declarations that matter for</span></span><a name="a2459"></a><br />2459  <span class="src-str"><span class="src-comm">	 * this code block instead of the whole thing</span></span><a name="a2460"></a><br />2460  <span class="src-str"><span class="src-comm">     *</span></span><a name="a2461"></a><br />2461  <span class="src-str"><span class="src-comm">     * @param  boolean Whether to use economy mode or not </span></span><a name="a2462"></a><br />2462  <span class="src-str"><span class="src-comm">     * @return string A stylesheet built on the data for the current language</span></span><a name="a2463"></a><br />2463  <span class="src-str"><span class="src-comm">     * @since  1.0.0</span></span><a name="a2464"></a><br />2464  <span class="src-str"><span class="src-comm">	 */</span></span><a name="a2465"></a><br />2465  <span class="src-str">    <span class="src-key">function</span> <span class="src-id">get_stylesheet</span> <span class="src-sym">(</span><span class="src-var">$economy_mode</span> = <span class="src-id">true</span><span class="src-sym">)</span></span><a name="a2466"></a><br />2466  <span class="src-str">    <span class="src-sym">{</span></span><a name="a2467"></a><br />2467  <span class="src-str">        <span class="src-comm">// If there's an error, chances are that the language file</span></span><a name="a2468"></a><br />2468  <span class="src-str">        <span class="src-comm">// won't have populated the language data file, so we can't</span></span><a name="a2469"></a><br />2469  <span class="src-str">        <span class="src-comm">// risk getting a stylesheet...</span></span><a name="a2470"></a><br />2470  <span class="src-str">        <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">error</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2471"></a><br />2471  <span class="src-str">            <span class="src-key">return</span> <span class="src-str">''</span>;</span><a name="a2472"></a><br />2472  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2473"></a><br />2473  <span class="src-str">        <span class="src-comm">// First, work out what the selector should be. If there's an ID,</span></span><a name="a2474"></a><br />2474  <span class="src-str">        <span class="src-comm">// that should be used, the same for a class. Otherwise, a selector</span></span><a name="a2475"></a><br />2475  <span class="src-str">        <span class="src-comm">// of '' means that these styles will be applied anywhere</span></span><a name="a2476"></a><br />2476  <span class="src-str">        <span class="src-var">$selector</span> = <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">overall_id</span> != <span class="src-str">''</span><span class="src-sym">)</span> ? <span class="src-str">"#</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">overall_id</span><span class="src-sym">}</span> <span class="src-str">" : <span class="src-str">''</span>;</span><a name="a2477"></a><br />2477  <span class="src-str">        <span class="src-var">$selector</span> = <span class="src-sym">(</span><span class="src-var">$selector</span> == <span class="src-str">''</span> &amp;&amp; <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">overall_class</span> != <span class="src-str">''</span><span class="src-sym">)</span> ? <span class="src-str">".</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">overall_class</span><span class="src-sym">}</span> <span class="src-str">" : <span class="src-var">$selector</span>;</span><a name="a2478"></a><br />2478  <a name="a2479"></a><br />2479  <span class="src-str">        <span class="src-comm">// Header of the stylesheet</span></span><a name="a2480"></a><br />2480  <span class="src-str">        <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span><span class="src-sym">)</span> <span class="src-sym">{</span></span><a name="a2481"></a><br />2481  <span class="src-str">            <span class="src-var">$stylesheet</span> = "/**\n * <span class="src-id">GeSHi</span> <span class="src-id">Dynamically</span> <span class="src-id">Generated</span> <span class="src-id">Stylesheet</span>\n * --------------------------------------\n * <span class="src-id">Dynamically</span> <span class="src-id">generated</span> <span class="src-id">stylesheet</span> <span class="src-id">for</span> </span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language</span><span class="src-sym">}</span>\n * <span class="src-id">CSS</span> <span class="src-id">class</span>: {<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">overall_class</span><span class="src-sym">}</span>, <span class="src-id">CSS</span> <span class="src-id">id</span>: {<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">overall_id</span><span class="src-sym">}</span>\n * <span class="src-id">GeSHi</span> (<span class="src-id">c</span>) <span class="src-id">Nigel</span> <span class="src-id">McNie</span> 2004 (<span class="src-id">http</span>://<span class="src-id">qbnz</span>.<span class="src-id">com</span>/<span class="src-id">highlighter</span>)\n */\n<span class="src-str">";</span><a name="a2482"></a><br />2482  <span class="src-str">         <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span></span><a name="a2483"></a><br />2483  <span class="src-str">            <span class="src-var">$stylesheet</span> = <span class="src-str">'/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */'</span> . <span class="src-str">&quot;\n&quot;</span>;</span><a name="a2484"></a><br />2484  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2485"></a><br />2485  <a name="a2486"></a><br />2486  <span class="src-str">        <span class="src-comm">// Set the &lt;ol&gt; to have no effect at all if there are line numbers</span></span><a name="a2487"></a><br />2487  <span class="src-str">        <span class="src-comm">// (&lt;ol&gt;s have margins that should be destroyed so all layout is</span></span><a name="a2488"></a><br />2488  <span class="src-str">        <span class="src-comm">// controlled by the set_overall_style method, which works on the</span></span><a name="a2489"></a><br />2489  <span class="src-str">        <span class="src-comm">// &lt;pre&gt; or &lt;div&gt; container). Additionally, set default styles for lines</span></span><a name="a2490"></a><br />2490  <span class="src-str">        <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">line_numbers</span> != <span class="src-id">GESHI_NO_LINE_NUMBERS</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2491"></a><br />2491  <span class="src-str">            <span class="src-comm">//$stylesheet .= &quot;$selector, {$selector}ol, {$selector}ol li {margin: 0;}\n&quot;;</span></span><a name="a2492"></a><br />2492  <span class="src-str">            <span class="src-var">$stylesheet</span> .= "<span class="src-var">$selector</span>.<span class="src-id">de1</span>, <span class="src-var">$selector</span>.<span class="src-id">de2</span> <span class="src-sym">{</span></span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">code_style</span><span class="src-sym">}</span><span class="src-str"><span class="src-sym">}</span>\n";</span><a name="a2493"></a><br />2493  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2494"></a><br />2494  <a name="a2495"></a><br />2495  <span class="src-str">        <span class="src-comm">// Add overall styles</span></span><a name="a2496"></a><br />2496  <span class="src-str">        <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">overall_style</span> != <span class="src-str">''</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2497"></a><br />2497  <span class="src-str">            <span class="src-var">$stylesheet</span> .= "<span class="src-var">$selector</span> <span class="src-sym">{</span></span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">overall_style</span><span class="src-sym">}</span><span class="src-str"><span class="src-sym">}</span>\n";</span><a name="a2498"></a><br />2498  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2499"></a><br />2499  <a name="a2500"></a><br />2500  <span class="src-str">        <span class="src-comm">// Add styles for links</span></span><a name="a2501"></a><br />2501  <span class="src-str">        <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">link_styles</span> <span class="src-key">as</span> <span class="src-var">$key</span> =&gt; <span class="src-var">$style</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2502"></a><br />2502  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-var">$key</span> == <span class="src-id">GESHI_LINK</span> &amp;&amp; <span class="src-var">$style</span> != <span class="src-str">''</span><span class="src-sym">)</span> <span class="src-sym">{</span></span><a name="a2503"></a><br />2503  <span class="src-str">                <span class="src-var">$stylesheet</span> .= "</span>{<span class="src-var">$selector</span><span class="src-str"><span class="src-sym">}</span><span class="src-id">a</span>:<span class="src-id">link</span> <span class="src-sym">{</span></span>{<span class="src-var">$style</span><span class="src-str"><span class="src-sym">}</span><span class="src-sym">}</span>\n";</span><a name="a2504"></a><br />2504  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2505"></a><br />2505  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-var">$key</span> == <span class="src-id">GESHI_HOVER</span> &amp;&amp; <span class="src-var">$style</span> != <span class="src-str">''</span><span class="src-sym">)</span> <span class="src-sym">{</span></span><a name="a2506"></a><br />2506  <span class="src-str">                <span class="src-var">$stylesheet</span> .= "</span>{<span class="src-var">$selector</span><span class="src-str"><span class="src-sym">}</span><span class="src-id">a</span>:<span class="src-id">hover</span> <span class="src-sym">{</span></span>{<span class="src-var">$style</span><span class="src-str"><span class="src-sym">}</span><span class="src-sym">}</span>\n";</span><a name="a2507"></a><br />2507  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2508"></a><br />2508  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-var">$key</span> == <span class="src-id">GESHI_ACTIVE</span> &amp;&amp; <span class="src-var">$style</span> != <span class="src-str">''</span><span class="src-sym">)</span> <span class="src-sym">{</span></span><a name="a2509"></a><br />2509  <span class="src-str">                <span class="src-var">$stylesheet</span> .= "</span>{<span class="src-var">$selector</span><span class="src-str"><span class="src-sym">}</span><span class="src-id">a</span>:<span class="src-id">active</span> <span class="src-sym">{</span></span>{<span class="src-var">$style</span><span class="src-str"><span class="src-sym">}</span><span class="src-sym">}</span>\n";</span><a name="a2510"></a><br />2510  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2511"></a><br />2511  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-var">$key</span> == <span class="src-id">GESHI_VISITED</span> &amp;&amp; <span class="src-var">$style</span> != <span class="src-str">''</span><span class="src-sym">)</span> <span class="src-sym">{</span></span><a name="a2512"></a><br />2512  <span class="src-str">                <span class="src-var">$stylesheet</span> .= "</span>{<span class="src-var">$selector</span><span class="src-str"><span class="src-sym">}</span><span class="src-id">a</span>:<span class="src-id">visited</span> <span class="src-sym">{</span></span>{<span class="src-var">$style</span><span class="src-str"><span class="src-sym">}</span><span class="src-sym">}</span>\n";</span><a name="a2513"></a><br />2513  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2514"></a><br />2514  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2515"></a><br />2515  <a name="a2516"></a><br />2516  <span class="src-str">        <span class="src-comm">// Header and footer</span></span><a name="a2517"></a><br />2517  <span class="src-str">        <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">header_content_style</span> != <span class="src-str">''</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2518"></a><br />2518  <span class="src-str">            <span class="src-var">$stylesheet</span> .= "<span class="src-var">$selector</span>.<span class="src-id">head</span> <span class="src-sym">{</span></span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">header_content_style</span><span class="src-sym">}</span><span class="src-str"><span class="src-sym">}</span>\n";</span><a name="a2519"></a><br />2519  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2520"></a><br />2520  <span class="src-str">        <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">footer_content_style</span> != <span class="src-str">''</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2521"></a><br />2521  <span class="src-str">            <span class="src-var">$stylesheet</span> .= "<span class="src-var">$selector</span>.<span class="src-id">foot</span> <span class="src-sym">{</span></span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">footer_content_style</span><span class="src-sym">}</span><span class="src-str"><span class="src-sym">}</span>\n";</span><a name="a2522"></a><br />2522  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2523"></a><br />2523  <a name="a2524"></a><br />2524  <span class="src-str">        <span class="src-comm">// Styles for important stuff</span></span><a name="a2525"></a><br />2525  <span class="src-str">        <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">important_styles</span> != <span class="src-str">''</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2526"></a><br />2526  <span class="src-str">            <span class="src-var">$stylesheet</span> .= "<span class="src-var">$selector</span>.<span class="src-id">imp</span> <span class="src-sym">{</span></span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">important_styles</span><span class="src-sym">}</span><span class="src-str"><span class="src-sym">}</span>\n";</span><a name="a2527"></a><br />2527  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2528"></a><br />2528  <a name="a2529"></a><br />2529  <span class="src-str">        <span class="src-comm">// Styles for lines being highlighted extra</span></span><a name="a2530"></a><br />2530  <span class="src-str">        <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-id">count</span><span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2531"></a><br />2531  <span class="src-str">            <span class="src-var">$stylesheet</span> .= "<span class="src-var">$selector</span>.<span class="src-id">ln</span>-<span class="src-id">xtra</span> <span class="src-sym">{</span></span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines_style</span><span class="src-sym">}</span><span class="src-str"><span class="src-sym">}</span>\n";</span><a name="a2532"></a><br />2532  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2533"></a><br />2533  <a name="a2534"></a><br />2534  <span class="src-str">        <span class="src-comm">// Simple line number styles</span></span><a name="a2535"></a><br />2535  <span class="src-str">        <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">line_numbers</span> != <span class="src-id">GESHI_NO_LINE_NUMBERS</span> &amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_style1</span> != <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2536"></a><br />2536  <span class="src-str">            <span class="src-var">$stylesheet</span> .= "</span>{<span class="src-var">$selector</span><span class="src-str"><span class="src-sym">}</span><span class="src-id">li</span> <span class="src-sym">{</span></span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_style1</span><span class="src-sym">}</span><span class="src-str"><span class="src-sym">}</span>\n";</span><a name="a2537"></a><br />2537  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2538"></a><br />2538  <a name="a2539"></a><br />2539  <span class="src-str">        <span class="src-comm">// If there is a style set for fancy line numbers, echo it out</span></span><a name="a2540"></a><br />2540  <span class="src-str">        <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">line_numbers</span> == <span class="src-id">GESHI_FANCY_LINE_NUMBERS</span> &amp;&amp; <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_style2</span> != <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2541"></a><br />2541  <span class="src-str">            <span class="src-var">$stylesheet</span> .= "</span>{<span class="src-var">$selector</span><span class="src-str"><span class="src-sym">}</span><span class="src-id">li</span>.<span class="src-id">li2</span> <span class="src-sym">{</span></span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_style2</span><span class="src-sym">}</span><span class="src-str"><span class="src-sym">}</span>\n";</span><a name="a2542"></a><br />2542  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2543"></a><br />2543  <a name="a2544"></a><br />2544  <span class="src-str">        <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$group</span> =&gt; <span class="src-var">$styles</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2545"></a><br />2545  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-sym">!</span><span class="src-sym">(</span><span class="src-var">$economy_mode</span> &amp;&amp; <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span> || <span class="src-var">$styles</span> == <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2546"></a><br />2546  <span class="src-str">                <span class="src-var">$stylesheet</span> .= "<span class="src-var">$selector</span>.<span class="src-id">kw</span><span class="src-var">$group</span> <span class="src-sym">{</span></span>{<span class="src-var">$styles</span><span class="src-str"><span class="src-sym">}</span><span class="src-sym">}</span>\n";</span><a name="a2547"></a><br />2547  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2548"></a><br />2548  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2549"></a><br />2549  <span class="src-str">        <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$group</span> =&gt; <span class="src-var">$styles</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2550"></a><br />2550  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-sym">!</span><span class="src-sym">(</span><span class="src-var">$economy_mode</span> &amp;&amp; <span class="src-var">$styles</span> == <span class="src-str">''</span><span class="src-sym">)</span> &amp;&amp;</span><a name="a2551"></a><br />2551  <span class="src-str">                <span class="src-sym">!</span><span class="src-sym">(</span><span class="src-var">$economy_mode</span> &amp;&amp; <span class="src-sym">!</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2552"></a><br />2552  <span class="src-str">                <span class="src-var">$stylesheet</span> .= "<span class="src-var">$selector</span>.<span class="src-id">co</span><span class="src-var">$group</span> <span class="src-sym">{</span></span>{<span class="src-var">$styles</span><span class="src-str"><span class="src-sym">}</span><span class="src-sym">}</span>\n";</span><a name="a2553"></a><br />2553  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2554"></a><br />2554  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2555"></a><br />2555  <span class="src-str">        <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$group</span> =&gt; <span class="src-var">$styles</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2556"></a><br />2556  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-sym">!</span><span class="src-sym">(</span><span class="src-var">$economy_mode</span> &amp;&amp; <span class="src-var">$styles</span> == <span class="src-str">''</span><span class="src-sym">)</span> &amp;&amp; <span class="src-sym">!</span><span class="src-sym">(</span><span class="src-var">$economy_mode</span> &amp;&amp;</span><a name="a2557"></a><br />2557  <span class="src-str">                <span class="src-sym">!</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2558"></a><br />2558  <span class="src-str">                <span class="src-var">$stylesheet</span> .= "<span class="src-var">$selector</span>.<span class="src-id">es</span><span class="src-var">$group</span> <span class="src-sym">{</span></span>{<span class="src-var">$styles</span><span class="src-str"><span class="src-sym">}</span><span class="src-sym">}</span>\n";</span><a name="a2559"></a><br />2559  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2560"></a><br />2560  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2561"></a><br />2561  <span class="src-str">        <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'SYMBOLS'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$group</span> =&gt; <span class="src-var">$styles</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2562"></a><br />2562  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-sym">!</span><span class="src-sym">(</span><span class="src-var">$economy_mode</span> &amp;&amp; <span class="src-var">$styles</span> == <span class="src-str">''</span><span class="src-sym">)</span> &amp;&amp; <span class="src-sym">!</span><span class="src-sym">(</span><span class="src-var">$economy_mode</span> &amp;&amp;</span><a name="a2563"></a><br />2563  <span class="src-str">                <span class="src-sym">!</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2564"></a><br />2564  <span class="src-str">                <span class="src-var">$stylesheet</span> .= "<span class="src-var">$selector</span>.<span class="src-id">br</span><span class="src-var">$group</span> <span class="src-sym">{</span></span>{<span class="src-var">$styles</span><span class="src-str"><span class="src-sym">}</span><span class="src-sym">}</span>\n";</span><a name="a2565"></a><br />2565  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2566"></a><br />2566  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2567"></a><br />2567  <span class="src-str">        <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$group</span> =&gt; <span class="src-var">$styles</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2568"></a><br />2568  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-sym">!</span><span class="src-sym">(</span><span class="src-var">$economy_mode</span> &amp;&amp; <span class="src-var">$styles</span> == <span class="src-str">''</span><span class="src-sym">)</span> &amp;&amp; <span class="src-sym">!</span><span class="src-sym">(</span><span class="src-var">$economy_mode</span> &amp;&amp;</span><a name="a2569"></a><br />2569  <span class="src-str">                <span class="src-sym">!</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2570"></a><br />2570  <span class="src-str">                <span class="src-var">$stylesheet</span> .= "<span class="src-var">$selector</span>.<span class="src-id">st</span><span class="src-var">$group</span> <span class="src-sym">{</span></span>{<span class="src-var">$styles</span><span class="src-str"><span class="src-sym">}</span><span class="src-sym">}</span>\n";</span><a name="a2571"></a><br />2571  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2572"></a><br />2572  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2573"></a><br />2573  <span class="src-str">        <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$group</span> =&gt; <span class="src-var">$styles</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2574"></a><br />2574  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-sym">!</span><span class="src-sym">(</span><span class="src-var">$economy_mode</span> &amp;&amp; <span class="src-var">$styles</span> == <span class="src-str">''</span><span class="src-sym">)</span> &amp;&amp; <span class="src-sym">!</span><span class="src-sym">(</span><span class="src-var">$economy_mode</span> &amp;&amp;</span><a name="a2575"></a><br />2575  <span class="src-str">                <span class="src-sym">!</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2576"></a><br />2576  <span class="src-str">                <span class="src-var">$stylesheet</span> .= "<span class="src-var">$selector</span>.<span class="src-id">nu</span><span class="src-var">$group</span> <span class="src-sym">{</span></span>{<span class="src-var">$styles</span><span class="src-str"><span class="src-sym">}</span><span class="src-sym">}</span>\n";</span><a name="a2577"></a><br />2577  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2578"></a><br />2578  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2579"></a><br />2579  <span class="src-str">        <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'METHODS'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$group</span> =&gt; <span class="src-var">$styles</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2580"></a><br />2580  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-sym">!</span><span class="src-sym">(</span><span class="src-var">$economy_mode</span> &amp;&amp; <span class="src-var">$styles</span> == <span class="src-str">''</span><span class="src-sym">)</span> &amp;&amp; <span class="src-sym">!</span><span class="src-sym">(</span><span class="src-var">$economy_mode</span> &amp;&amp;</span><a name="a2581"></a><br />2581  <span class="src-str">                <span class="src-sym">!</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'METHODS'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2582"></a><br />2582  <span class="src-str">                <span class="src-var">$stylesheet</span> .= "<span class="src-var">$selector</span>.<span class="src-id">me</span><span class="src-var">$group</span> <span class="src-sym">{</span></span>{<span class="src-var">$styles</span><span class="src-str"><span class="src-sym">}</span><span class="src-sym">}</span>\n";</span><a name="a2583"></a><br />2583  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2584"></a><br />2584  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2585"></a><br />2585  <span class="src-str">        <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'SCRIPT'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$group</span> =&gt; <span class="src-var">$styles</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2586"></a><br />2586  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-sym">!</span><span class="src-sym">(</span><span class="src-var">$economy_mode</span> &amp;&amp; <span class="src-var">$styles</span> == <span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span></span><a name="a2587"></a><br />2587  <span class="src-str">                <span class="src-var">$stylesheet</span> .= "<span class="src-var">$selector</span>.<span class="src-id">sc</span><span class="src-var">$group</span> <span class="src-sym">{</span></span>{<span class="src-var">$styles</span><span class="src-str"><span class="src-sym">}</span><span class="src-sym">}</span>\n";</span><a name="a2588"></a><br />2588  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2589"></a><br />2589  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2590"></a><br />2590  <span class="src-str">        <span class="src-key">foreach</span> <span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span> <span class="src-key">as</span> <span class="src-var">$group</span> =&gt; <span class="src-var">$styles</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2591"></a><br />2591  <span class="src-str">            <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span> || <span class="src-sym">!</span><span class="src-sym">(</span><span class="src-var">$economy_mode</span> &amp;&amp; <span class="src-var">$styles</span> == <span class="src-str">''</span><span class="src-sym">)</span> &amp;&amp; <span class="src-sym">!</span><span class="src-sym">(</span><span class="src-var">$economy_mode</span> &amp;&amp;</span><a name="a2592"></a><br />2592  <span class="src-str">                <span class="src-sym">!</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2593"></a><br />2593  <span class="src-str">                <span class="src-var">$stylesheet</span> .= "<span class="src-var">$selector</span>.<span class="src-id">re</span><span class="src-var">$group</span> <span class="src-sym">{</span></span>{<span class="src-var">$styles</span><span class="src-str"><span class="src-sym">}</span><span class="src-sym">}</span>\n";</span><a name="a2594"></a><br />2594  <span class="src-str">            <span class="src-sym">}</span></span><a name="a2595"></a><br />2595  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2596"></a><br />2596  <a name="a2597"></a><br />2597  <span class="src-str">        <span class="src-key">return</span> <span class="src-var">$stylesheet</span>;</span><a name="a2598"></a><br />2598  <span class="src-str">    <span class="src-sym">}</span></span><a name="a2599"></a><br />2599  <a name="a2600"></a><br />2600  <span class="src-str"><span class="src-sym">}</span> <span class="src-comm">// End Class GeSHi</span></span><a name="a2601"></a><br />2601  <a name="a2602"></a><br />2602  <a name="a2603"></a><br />2603  <span class="src-str"><span class="src-key">if</span> <span class="src-sym">(</span><span class="src-sym">!</span><span class="src-id">function_exists</span><span class="src-sym">(</span><span class="src-str">'geshi_highlight'</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-sym">{</span></span><a name="a2604"></a><br />2604  <span class="src-str">    <span class="src-comm">/**</span></span><a name="a2605"></a><br />2605  <span class="src-str"><span class="src-comm">     * Easy way to highlight stuff. Behaves just like highlight_string</span></span><a name="a2606"></a><br />2606  <span class="src-str"><span class="src-comm">     * </span></span><a name="a2607"></a><br />2607  <span class="src-str"><span class="src-comm">     * @param string The code to highlight</span></span><a name="a2608"></a><br />2608  <span class="src-str"><span class="src-comm">     * @param string The language to highlight the code in</span></span><a name="a2609"></a><br />2609  <span class="src-str"><span class="src-comm">     * @param string The path to the language files. You can leave this blank if you need</span></span><a name="a2610"></a><br />2610  <span class="src-str"><span class="src-comm">     *               as from version 1.0.7 the path should be automatically detected</span></span><a name="a2611"></a><br />2611  <span class="src-str"><span class="src-comm">     * @param boolean Whether to return the result or to echo</span></span><a name="a2612"></a><br />2612  <span class="src-str"><span class="src-comm">     * @return string The code highlighted (if $return is true)</span></span><a name="a2613"></a><br />2613  <span class="src-str"><span class="src-comm">     * @since 1.0.2</span></span><a name="a2614"></a><br />2614  <span class="src-str"><span class="src-comm">     */</span></span><a name="a2615"></a><br />2615  <span class="src-str">    <span class="src-key">function</span> <span class="src-id">geshi_highlight</span> <span class="src-sym">(</span><span class="src-var">$string</span><span class="src-sym">,</span> <span class="src-var">$language</span><span class="src-sym">,</span> <span class="src-var">$path</span><span class="src-sym">,</span> <span class="src-var">$return</span> = <span class="src-id">false</span><span class="src-sym">)</span></span><a name="a2616"></a><br />2616  <span class="src-str">    <span class="src-sym">{</span></span><a name="a2617"></a><br />2617  <span class="src-str">        <span class="src-var">$geshi</span> = <span class="src-key">new</span> <span class="src-id">GeSHi</span><span class="src-sym">(</span><span class="src-var">$string</span><span class="src-sym">,</span> <span class="src-var">$language</span><span class="src-sym">,</span> <span class="src-var">$path</span><span class="src-sym">)</span>;</span><a name="a2618"></a><br />2618  <span class="src-str">        <span class="src-var">$geshi</span></span><span class="src-sym">-&gt;</span><span class="src-id">set_header_type</span><span class="src-sym">(</span><span class="src-id">GESHI_HEADER_DIV</span><span class="src-sym">)</span>;<a name="a2619"></a><br />2619          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$return</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2620"></a><br />2620  <span class="src-str">            <span class="src-key">return</span> <span class="src-id">str_replace</span><span class="src-sym">(</span><span class="src-str">'&lt;div&gt;'</span><span class="src-sym">,</span> <span class="src-str">'&lt;code&gt;'</span><span class="src-sym">,</span> <span class="src-id">str_replace</span><span class="src-sym">(</span><span class="src-str">'&lt;/div&gt;'</span><span class="src-sym">,</span> <span class="src-str">'&lt;/code&gt;'</span><span class="src-sym">,</span> <span class="src-var">$geshi</span></span><span class="src-sym">-&gt;</span><span class="src-id">parse_code</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a2621"></a><br />2621          <span class="src-str"><span class="src-sym">}</span></span><a name="a2622"></a><br />2622  <span class="src-str">        echo <span class="src-id">str_replace</span><span class="src-sym">(</span><span class="src-str">'&lt;div&gt;'</span><span class="src-sym">,</span> <span class="src-str">'&lt;code&gt;'</span><span class="src-sym">,</span> <span class="src-id">str_replace</span><span class="src-sym">(</span><span class="src-str">'&lt;/div&gt;'</span><span class="src-sym">,</span> <span class="src-str">'&lt;/code&gt;'</span><span class="src-sym">,</span> <span class="src-var">$geshi</span></span><span class="src-sym">-&gt;</span><span class="src-id">parse_code</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a2623"></a><br />2623          <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$geshi</span><span class="src-sym">-&gt;</span><span class="src-id">error</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-str"><span class="src-sym">{</span></span><a name="a2624"></a><br />2624  <span class="src-str">            <span class="src-key">return</span> <span class="src-id">false</span>;</span><a name="a2625"></a><br />2625  <span class="src-str">        <span class="src-sym">}</span></span><a name="a2626"></a><br />2626  <span class="src-str">        <span class="src-key">return</span> <span class="src-id">true</span>;</span><a name="a2627"></a><br />2627  <span class="src-str">    <span class="src-sym">}</span></span><a name="a2628"></a><br />2628  <span class="src-str"><span class="src-sym">}</span></span><a name="a2629"></a><br />2629  </pre>
</div>
	<p class="notes" id="credit">
		Documentation generated on Thu, 22 Sep 2005 13:47:59 +1200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.3</a>
	</p>
	</body>
</html>